1 #ifndef AbstractTreeModel_H
2 #define AbstractTreeModel_H
19 template<
typename A,
typename B >
struct QPair;
25 class AbstractTreeItem;
51 enum InterestingItems {
55 AllItems = PointItems | MeasureItems | ImageItems
57 Q_DECLARE_FLAGS(InterestingItemsFlag, InterestingItems)
66 InterestingItemsFlag = AllItems,
bool =
false);
70 InterestingItemsFlag = AllItems,
bool =
false);
71 QMutex *getMutex()
const;
72 int getItemCount(InterestingItemsFlag)
const;
73 int getTopLevelItemCount()
const;
74 int getVisibleItemCount(InterestingItemsFlag,
bool)
const;
75 int getVisibleTopLevelItemCount()
const;
77 void setDrivable(
bool drivableStatus);
78 bool isDrivable()
const;
79 bool isFiltering()
const;
80 bool isRebuilding()
const;
81 void setRebuilding(
bool running) { m_rebuildRunning = running; }
83 void setGlobalSelection(
bool selected, InterestingItemsFlag = AllItems);
87 InterestingItemsFlag = AllItems,
90 bool isFrozen()
const;
100 void modelModified();
101 void filterProgressChanged(
int);
102 void filterProgressRangeChanged(
int,
int);
103 void rebuildProgressChanged(
int);
104 void rebuildProgressRangeChanged(
int,
int);
114 int topLevelItemCount);
118 virtual void rebuildItems() = 0;
128 InterestingItemsFlag flags,
bool ignoreExpansion)
const;
130 InterestingItemsFlag flags);
131 static bool itemIsInteresting(
137 void applyFilterDone();
138 void rebuildItemsDone();
147 getRebuildWatcher()
const;
169 bool m_filterRunning;
170 bool m_rebuildRunning;
172 bool m_rebuildPending;
182 :
public std::unary_function< AbstractTreeItem *const &, bool > {
191 static void updateTopLevelLinks(
201 Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractTreeModel::InterestingItemsFlag)