diff options
author | Nils Schwabe | 2014-03-03 15:14:20 +0100 |
---|---|---|
committer | Nils Schwabe | 2014-03-03 15:14:20 +0100 |
commit | 030d91e628a2ecd5634376c9c4d903a1fa0fb423 (patch) | |
tree | 227029e3b48deb1d4d01ce497d9ec3b8d47f7a61 /src/sessiontreemodel.h | |
parent | Initial commit (diff) | |
download | vmchooser2-030d91e628a2ecd5634376c9c4d903a1fa0fb423.tar.gz vmchooser2-030d91e628a2ecd5634376c9c4d903a1fa0fb423.tar.xz vmchooser2-030d91e628a2ecd5634376c9c4d903a1fa0fb423.zip |
added files from vmchooser1
Diffstat (limited to 'src/sessiontreemodel.h')
-rw-r--r-- | src/sessiontreemodel.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/sessiontreemodel.h b/src/sessiontreemodel.h new file mode 100644 index 0000000..b5d8ff8 --- /dev/null +++ b/src/sessiontreemodel.h @@ -0,0 +1,35 @@ +#ifndef VMCHOOSER_SESSIONTREEMODEL_H +#define VMCHOOSER_SESSIONTREEMODEL_H + +#include <QAbstractItemModel> +#include <QModelIndex> +#include <QVariant> + +class SessionTreeItem; +class Session; + +class SessionTreeModel : public QAbstractItemModel { + Q_OBJECT + + public: + explicit SessionTreeModel(QObject *parent = 0); + ~SessionTreeModel(); + + QVariant data(const QModelIndex &index, int role) const; + Qt::ItemFlags flags(const QModelIndex &index) const; + QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const; + QModelIndex index(int row, int column, + const QModelIndex &parent = QModelIndex()) const; + QModelIndex parent(const QModelIndex &index) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + + void addItems(const QList<Session*>& sessions, const QString& section); + + + private: + SessionTreeItem* root_; +}; + +#endif // VMCHOOSER_SESSIONTREEMODEL_H |