1#ifndef AbstractTreeModel_H
2#define AbstractTreeModel_H
20template<
typename A,
typename B >
struct QPair;
26 class AbstractTreeItem;
66 QList< AbstractTreeItem * >
getItems(
int,
int,
67 InterestingItemsFlag =
AllItems,
bool =
false);
71 InterestingItemsFlag =
AllItems,
bool =
false);
115 int topLevelItemCount);
129 InterestingItemsFlag flags,
bool ignoreExpansion)
const;
131 InterestingItemsFlag flags);
132 static bool itemIsInteresting(
138 void applyFilterDone();
139 void rebuildItemsDone();
147 QFutureWatcher< QAtomicPointer< RootItem > > *
158 QFutureWatcher< QAtomicPointer< AbstractTreeItem > > * m_filterWatcher;
159 QFutureWatcher< QAtomicPointer< RootItem > > * m_rebuildWatcher;
160 QList< QPair< QString, QString > > * m_expandedState;
161 QList< QPair< QString, QString > > * m_selectedState;
170 bool m_filterRunning;
171 bool m_rebuildRunning;
173 bool m_rebuildPending;
183 :
public std::function<bool(AbstractTreeItem *const &)> {
186 FilterFunctor(FilterFunctor
const &other);
189 FilterFunctor &operator=(FilterFunctor
const &);
192 static void updateTopLevelLinks(
193 QAtomicPointer< AbstractTreeItem > & root,
202 Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractTreeModel::InterestingItemsFlag)
Base class for an item in the tree.
Definition AbstractTreeItem.h:39
Base class for tree models.
Definition AbstractTreeModel.h:48
QList< AbstractTreeItem * > getSelectedItems(InterestingItemsFlag=AllItems, bool=false)
Definition AbstractTreeModel.cpp:228
RootItem * getRootItem() const
Definition AbstractTreeModel.cpp:388
void filterProgressRangeChanged(int, int)
int getItemCount(InterestingItemsFlag) const
Definition AbstractTreeModel.cpp:255
void setRebuilding(bool running)
Definition AbstractTreeModel.h:82
void setFrozen(bool)
Definition AbstractTreeModel.cpp:325
QList< AbstractTreeItem * > getItems(int, int, InterestingItemsFlag=AllItems, bool=false)
Definition AbstractTreeModel.cpp:118
void setDrivable(bool drivableStatus)
void filterProgressChanged(int)
int indexOfVisibleItem(AbstractTreeItem const *item, InterestingItemsFlag=AllItems, bool=false) const
Definition AbstractTreeModel.cpp:302
void filterCountsChanged(int visibleTopLevelItemCount, int topLevelItemCount)
This signal is emitted after filtering to provide the number of visible top-level items remaining aft...
RootItem * rootItem
Definition AbstractTreeModel.h:154
void clear()
Definition AbstractTreeModel.cpp:369
void setFilter(FilterWidget *newFilter)
Definition AbstractTreeModel.cpp:359
TreeView * getView() const
Definition AbstractTreeModel.cpp:393
FilterWidget * getFilterWidget() const
QMutex * getMutex() const
Definition AbstractTreeModel.cpp:250
InterestingItems
Definition AbstractTreeModel.h:52
@ MeasureItems
Definition AbstractTreeModel.h:54
@ AllItems
Definition AbstractTreeModel.h:56
@ ImageItems
Definition AbstractTreeModel.h:55
@ PointItems
Definition AbstractTreeModel.h:53
int getTopLevelItemCount() const
Definition AbstractTreeModel.cpp:260
void setGlobalSelection(bool selected, InterestingItemsFlag=AllItems)
Definition AbstractTreeModel.cpp:476
int getVisibleTopLevelItemCount() const
Definition AbstractTreeModel.cpp:285
bool isFiltering() const
Definition AbstractTreeModel.cpp:349
QFutureWatcher< QAtomicPointer< RootItem > > * getRebuildWatcher() const
Definition AbstractTreeModel.cpp:383
void rebuildProgressChanged(int)
virtual void rebuildItems()=0
bool isRebuilding() const
Definition AbstractTreeModel.cpp:354
void queueRebuild()
Definition AbstractTreeModel.cpp:344
int getVisibleItemCount(InterestingItemsFlag, bool) const
Definition AbstractTreeModel.cpp:264
bool isFrozen() const
Definition AbstractTreeModel.cpp:339
void rebuildProgressRangeChanged(int, int)
virtual ~AbstractTreeModel()
Definition AbstractTreeModel.cpp:85
QSize getVisibleSize(int indentation) const
indentation is in pixels
Definition AbstractTreeModel.cpp:407
void treeSelectionChanged(QList< AbstractTreeItem * >)
void applyFilter()
Definition AbstractTreeModel.cpp:434
void stopWorking()
Definition AbstractTreeModel.cpp:398
void tableSelectionChanged(QList< AbstractTreeItem * >)
AbstractTreeModel(ControlNet *controlNet, TreeView *v, QObject *parent=0)
Definition AbstractTreeModel.cpp:42
ControlNet * getControlNetwork() const
Definition AbstractTreeModel.cpp:377
A leaf item that is not ready for user interaction.
Definition BusyLeafItem.h:33
a control network
Definition ControlNet.h:258
The root of a tree.
Definition RootItem.h:37
This is free and unencumbered software released into the public domain.
Definition AbstractTableModel.h:24
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
This is free and unencumbered software released into the public domain.
Definition CubeIoHandler.h:23