summaryrefslogtreecommitdiffstats
path: root/smtreemodel.h
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-06-06 16:26:58 +0200
committerArno <am@disconnect.de>2010-06-06 16:26:58 +0200
commite710b1ff68c29f5a2331cc36b5fdf6d67f4b1c63 (patch)
tree6005881d064e1912a253831a98ab4961fa7c6574 /smtreemodel.h
parent4d78abefd76d7d828a4ac078b80e8891ddb975e6 (diff)
downloadSheMov-e710b1ff68c29f5a2331cc36b5fdf6d67f4b1c63.tar.gz
SheMov-e710b1ff68c29f5a2331cc36b5fdf6d67f4b1c63.tar.bz2
SheMov-e710b1ff68c29f5a2331cc36b5fdf6d67f4b1c63.zip
Finished SmTreeModel, started SmUberModel
kinda finished the treemodel. Don't really know if it's complete yet. More programming will show :)
Diffstat (limited to 'smtreemodel.h')
-rw-r--r--smtreemodel.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/smtreemodel.h b/smtreemodel.h
index ede4b39..46f852f 100644
--- a/smtreemodel.h
+++ b/smtreemodel.h
@@ -19,7 +19,29 @@ class SmTreeModel : public QAbstractItemModel {
explicit SmTreeModel(const QStringList &headers, QObject *parent = 0);
~SmTreeModel();
+ // counts
+ int rowCount(const QModelIndex &parent) const;
+ int columnCount(const QModelIndex &parent) const;
+
+ // index and flags
+ QModelIndex index(int row, int column, const QModelIndex &parent) const;
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+
+ // headers + data
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+ bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role);
+ QVariant data(const QModelIndex &index, int role) const;
+ bool setData(const QModelIndex &index, const QVariant &value, int role);
+ bool setRoot(SmTreeItem *rootItem);
+
+ // row manipulation
+ bool insertRows(int row, int count, const QModelIndex &parent);
+ bool removeRows(int row, int count, const QModelIndex &parent);
+ bool addRow(const QList<QVariant> &data, const QModelIndex &parent);
+
+
private:
+ SmTreeItem *itemAt(const QModelIndex &index) const;
QStringList mHeaders;
SmTreeItem *mRootItem;
};