59 enum Filter : uint32_t
61 NoFilter = 0x00000000,
62 IgnoreInactiveStations = 0x00000001,
63 IgnoreNameChange = 0x00000002,
64 IgnoreIconChange = 0x00000004,
65 IgnoreAdd = 0x00000008,
66 IgnoreRemove = 0x00000010,
67 IgnoreChildren = 0x00000020,
79 uint32_t filter()
const;
80 uint32_t setFilter(uint32_t filter);
81 uint32_t setFilterFlag(uint32_t flag,
bool on =
true);
83 void setSubmitPolicy(SubmitPolicy policy);
86 void itemNameChanged(
IItem* item,
const QString& name);
87 void itemIconChanged(
IItem* item,
const QIcon& icon);
88 void itemAdded(
IItem* item);
89 void itemRemoved(
IItem* item);
96 void onModelDataChanged(
97 const QModelIndex& topLeft,
98 const QModelIndex& bottomRight,
99 const QVector<int>& roles = QVector<int>());
100 void onModelRowsInserted(
const QModelIndex& parent,
int first,
int last);
101 void onModelRowsRemoved(
const QModelIndex& parent,
int first,
int last);
106 inline size_t operator()(
const QString& s)
const {
return qHash(s); };
109 using TreeCallback = std::function<void(
const QModelIndex&)>;
112 void iterateOverTree(
113 const QModelIndex& parent,
114 const TreeCallback& callback,
115 bool reverse =
false);
116 IItem* itemFromIndex(
const QModelIndex& index)
const;
117 bool isActiveStationItem(
const QModelIndex& index)
const;
121 QTreeWidget* _tree =
nullptr;
123 uint32_t _filter = IgnoreInactiveStations;
124 SubmitPolicy _policy = AutoSubmit;
126 std::unordered_multimap<QString, IItem*, QStringHash> _nameTable;
127 std::unordered_map<IItem*, QString> _nameCache;
129 std::list<QModelIndex> _addedIndices;