From 7167ce41b61d2ba2cdb526777a4233eb84a3b66a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 6 Dec 2014 17:33:25 -0500 Subject: Imported Upstream version 2.99.6 --- .../guiSQLiteStudio/selectabledbobjmodel.h | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 SQLiteStudio3/guiSQLiteStudio/selectabledbobjmodel.h (limited to 'SQLiteStudio3/guiSQLiteStudio/selectabledbobjmodel.h') diff --git a/SQLiteStudio3/guiSQLiteStudio/selectabledbobjmodel.h b/SQLiteStudio3/guiSQLiteStudio/selectabledbobjmodel.h new file mode 100644 index 0000000..2fca1b4 --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/selectabledbobjmodel.h @@ -0,0 +1,44 @@ +#ifndef SELECTABLEDBOBJMODEL_H +#define SELECTABLEDBOBJMODEL_H + +#include "guiSQLiteStudio_global.h" +#include +#include + +class DbTreeItem; +class QTreeView; + +class GUI_API_EXPORT SelectableDbObjModel : public QSortFilterProxyModel +{ + Q_OBJECT + public: + explicit SelectableDbObjModel(QObject *parent = 0); + + QVariant data(const QModelIndex& index, int role) const; + bool setData(const QModelIndex& index, const QVariant& value, int role); + Qt::ItemFlags flags(const QModelIndex& index) const; + + QString getDbName() const; + void setDbName(const QString& value); + + QStringList getCheckedObjects() const; + void setCheckedObjects(const QStringList& value); + + void setRootChecked(bool checked); + DbTreeItem* getItemForIndex(const QModelIndex& index) const; + + protected: + bool filterAcceptsRow(int srcRow, const QModelIndex& srcParent) const; + + private: + DbTreeItem* getItemForProxyIndex(const QModelIndex& index) const; + Qt::CheckState getStateFromChilds(const QModelIndex& index) const; + void setRecurrently(const QModelIndex& index, Qt::CheckState checked); + bool isObject(DbTreeItem* item) const; + bool checkRecurrentlyForDb(DbTreeItem* item) const; + + QSet checkedObjects; + QString dbName; +}; + +#endif // SELECTABLEDBOBJMODEL_H -- cgit v1.2.3