summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-07-26 12:39:50 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-07-26 12:39:50 (GMT)
commita28d92f3458218d6effbfdd9a42bf8fbe8b8aa72 (patch)
treef666c221dcc899704bb80f67afe383e58b780669 /Swift/QtUI/Roster/RosterModel.h
parentc4660f404c9a0dbf1c00a20baacfc738d93eaff5 (diff)
downloadswift-a28d92f3458218d6effbfdd9a42bf8fbe8b8aa72.zip
swift-a28d92f3458218d6effbfdd9a42bf8fbe8b8aa72.tar.bz2
Begin to assage Swift model into Qt Model/View.
Diffstat (limited to 'Swift/QtUI/Roster/RosterModel.h')
-rw-r--r--Swift/QtUI/Roster/RosterModel.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Swift/QtUI/Roster/RosterModel.h b/Swift/QtUI/Roster/RosterModel.h
new file mode 100644
index 0000000..a958f0d
--- /dev/null
+++ b/Swift/QtUI/Roster/RosterModel.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "Swift/QtUI/Roster/RosterItem.h"
+
+#include <QAbstractItemModel>
+#include <QList>
+
+namespace Swift {
+class RosterModel : public QAbstractItemModel {
+public:
+ RosterModel(RosterItem* tree);
+ ~RosterModel();
+ int columnCount(const QModelIndex& parent = QModelIndex()) const;
+ QVariant data(const QModelIndex& index, 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;
+private:
+ RosterItem* tree_;
+};
+
+} \ No newline at end of file