1 #ifndef AbstractTreeModel_H
2 #define AbstractTreeModel_H
11 template<
typename A,
typename B >
struct QPair;
20 class AbstractTreeItem;
44 enum InterestingItems {
48 AllItems = PointItems | MeasureItems | SerialItems
50 Q_DECLARE_FLAGS(InterestingItemsFlag, InterestingItems)
59 InterestingItemsFlag = AllItems,
bool =
false);
63 InterestingItemsFlag = AllItems,
bool =
false);
64 QMutex *getMutex()
const;
65 int getItemCount(InterestingItemsFlag)
const;
66 int getTopLevelItemCount()
const;
67 int getVisibleItemCount(InterestingItemsFlag,
bool)
const;
68 int getVisibleTopLevelItemCount()
const;
70 void setDrivable(
bool drivableStatus);
71 bool isDrivable()
const;
72 bool isFiltering()
const;
73 bool isRebuilding()
const;
74 void setRebuilding(
bool running) { m_rebuildRunning = running; }
76 void setGlobalSelection(
bool selected, InterestingItemsFlag = AllItems);
80 InterestingItemsFlag = AllItems,
83 bool isFrozen()
const;
94 void filterProgressChanged(
int);
95 void filterProgressRangeChanged(
int,
int);
96 void rebuildProgressChanged(
int);
97 void rebuildProgressRangeChanged(
int,
int);
107 int topLevelItemCount);
111 virtual void rebuildItems() = 0;
121 InterestingItemsFlag flags,
bool ignoreExpansion)
const;
123 InterestingItemsFlag flags);
124 static bool itemIsInteresting(
130 void applyFilterDone();
131 void rebuildItemsDone();
140 getRebuildWatcher()
const;
162 bool m_filterRunning;
163 bool m_rebuildRunning;
165 bool m_rebuildPending;
175 :
public std::unary_function< AbstractTreeItem *const &, bool > {
184 static void updateTopLevelLinks(
194 Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractTreeModel::InterestingItemsFlag)
A leaf item that is not ready for user interaction.
Base class for an item in the tree.
Base class for tree models.
void filterCountsChanged(int visibleTopLevelItemCount, int topLevelItemCount)
This signal is emitted after filtering to provide the number of visible top-level items remaining aft...
QSize getVisibleSize(int indentation) const
indentation is in pixels