16#ifndef KDSME_UTIL_TREEWALKER_H
17#define KDSME_UTIL_TREEWALKER_H
19#include "kdsme_core_export.h"
62 : m_traversalType(type)
79 bool continueWalk =
true;
85 if (std::any_of(items.begin(), items.end(),
86 [&](
const T &child) { return !walkItems(child, visit); })) {
107 return !std::any_of(items.begin(), items.end(),
108 [&](
const T &child) { return !walkItems(child, visit); });
bool walkChildren(T item, const VisitFunction &visit)
std::function< VisitResult(T)> VisitFunction
bool walkItems(T item, const VisitFunction &visit)
TreeWalker(TraversalType type=PreOrderTraversal)
@ ContinueWalk
Continues traversal with the next sibling of the item just visited, without visiting its children.
@ RecursiveWalk
Traverse the children of this item.
@ StopWalk
Terminate the traversal.
static QList< T > children(T item)