2 #include <score/model/tree/InvisibleRootNode.hpp>
4 #include <score/serialization/JSONVisitor.hpp>
12 using cref =
const T&;
36 using impl_type = std::vector<int>;
47 QModelIndex iter = index;
67 while(iter && iter->parent())
69 prepend(iter->parent()->indexOfChild(iter));
70 iter = iter->parent();
74 void prepend(
int val) { this->insert(this->begin(), val); }
77 const T* toNode(
const T* iter)
const
79 const int pathSize = size();
81 for(
int i = 0; i < pathSize; ++i)
83 if(at(i) < iter->childCount())
85 iter = &iter->childAt(at(i));
97 T* toNode(T* iter)
const
99 const int pathSize = size();
101 for(
int i = 0; i < pathSize; ++i)
103 if(at(i) < iter->childCount())
105 iter = &iter->childAt(at(i));
118 struct is_custom_serialized<
TreePath> : std::true_type
128 s,
static_cast<const std::vector<int>&
>(path));
134 s,
static_cast<std::vector<int>&
>(path));
143 s.obj[s.strings.Path] =
static_cast<const std::vector<int>&
>(path);
148 static_cast<std::vector<int>&
>(path) <<= s.obj[s.strings.Path];
Definition: VisitorInterface.hpp:53
Definition: DataStreamVisitor.hpp:27
Definition: DataStreamVisitor.hpp:202
Definition: VisitorInterface.hpp:61
Definition: JSONVisitor.hpp:52
Definition: JSONVisitor.hpp:423
Path in a tree of QAbstractItemModel objects.
Definition: TreePath.hpp:34
Definition: VisitorInterface.hpp:13