Qx v0.5.8
Qt Extensions Library
Loading...
Searching...
No Matches
qx-standarditemmodel.h
1#ifndef QX_STANDARDITEMMODEL_H
2#define QX_STANDARDITEMMODEL_H
3
4// Shared Lib Support
5#include "qx/widgets/qx_widgets_export.h"
6
7// Qt Includes
8#include <QStandardItemModel>
9
10namespace Qx
11{
12
13class QX_WIDGETS_EXPORT StandardItemModel : public QStandardItemModel
14{
15//-Instance Members---------------------------------------------------------------------------------------------------
16private:
17 bool mUpdatingParentTristate = false;
18 bool mAutoTristate = false;
19
20//-Constructor-------------------------------------------------------------------------------------------------------
21public:
22 StandardItemModel(int rows, int columns, QObject *parent = nullptr);
23 StandardItemModel(QObject *parent = nullptr);
24
25//-Instance Functions-----------------------------------------------------------------------------------------------
26private:
27 void autoTristateChildren(QStandardItem* changingItem, const QVariant& value, int role);
28 void autoTristateParents(QStandardItem* changingItem, const QVariant& changingValue);
29
30public:
31 virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
32 bool isAutoTristate();
33 void setAutoTristate(bool autoTristate);
34 void forEachItem(std::function<void(QStandardItem*)> const& func, QModelIndex parent = QModelIndex());
35
36 void selectAll();
37 void selectNone();
38};
39
40}
41
42#endif // QX_STANDARDITEMMODEL_H
The StandardItemModel class is a more robust variant of QStandardItemModel, which is a generic model ...
Definition qx-standarditemmodel.h:14
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5
EditRole