diff options
| author | 2014-12-06 17:33:25 -0500 | |
|---|---|---|
| committer | 2014-12-06 17:33:25 -0500 | |
| commit | 7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch) | |
| tree | a35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/guiSQLiteStudio/dbobjlistmodel.h | |
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dbobjlistmodel.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/dbobjlistmodel.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dbobjlistmodel.h b/SQLiteStudio3/guiSQLiteStudio/dbobjlistmodel.h new file mode 100644 index 0000000..cac1202 --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dbobjlistmodel.h @@ -0,0 +1,59 @@ +#ifndef DBOBJLISTMODEL_H +#define DBOBJLISTMODEL_H + +#include "guiSQLiteStudio_global.h" +#include <QAbstractListModel> + +class Db; + +class GUI_API_EXPORT DbObjListModel : public QAbstractListModel +{ + Q_OBJECT + + public: + enum class SortMode + { + LikeInDb, + Alphabetical + }; + + enum class ObjectType + { + TABLE, + INDEX, + TRIGGER, + VIEW, + null + }; + + explicit DbObjListModel(QObject *parent = 0); + + QVariant data(const QModelIndex & index, int role) const; + int rowCount(const QModelIndex & parent = QModelIndex()) const; + QModelIndex sibling(int row, int column, const QModelIndex & idx) const; + + Db* getDb() const; + void setDb(Db* value); + + SortMode getSortMode() const; + void setSortMode(const SortMode& value); + + ObjectType getType() const; + void setType(const ObjectType& value); + + bool getIncludeSystemObjects() const; + void setIncludeSystemObjects(bool value); + + private: + void updateList(); + QString typeString() const; + + ObjectType type = ObjectType::null; + Db* db = nullptr; + SortMode sortMode = SortMode::LikeInDb; + QStringList objectList; + QStringList unsortedObjectList; + bool includeSystemObjects = true; +}; + +#endif // DBOBJLISTMODEL_H |
