diff options
author | Arno <am@disconnect.de> | 2010-06-03 21:06:30 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-06-03 21:06:30 +0200 |
commit | 4d78abefd76d7d828a4ac078b80e8891ddb975e6 (patch) | |
tree | 77168d0a74272b0be7e8d78cf3c9322f6c9aed55 /smtreeitem.h | |
parent | daa5c2eb9148b9175302228a6bae257e84881846 (diff) | |
download | SheMov-4d78abefd76d7d828a4ac078b80e8891ddb975e6.tar.gz SheMov-4d78abefd76d7d828a4ac078b80e8891ddb975e6.tar.bz2 SheMov-4d78abefd76d7d828a4ac078b80e8891ddb975e6.zip |
Started Treemodel for Archive
Implemented generic SmTreeItem, started on generic SmTreeModel.
Diffstat (limited to 'smtreeitem.h')
-rw-r--r-- | smtreeitem.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/smtreeitem.h b/smtreeitem.h new file mode 100644 index 0000000..4696edf --- /dev/null +++ b/smtreeitem.h @@ -0,0 +1,36 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. +*/ + +#ifndef SMTREEITEM_H +#define SMTREEITEM_H + +#include <QList> +#include <QVariant> + +class SmTreeItem { + public: + SmTreeItem(const QList<QVariant> &data, SmTreeItem *parent = 0); + SmTreeItem(int rows, SmTreeItem *parent = 0); + ~SmTreeItem(); + void appendChild(SmTreeItem *child); + SmTreeItem *child(int row); + int childCount() const; + int columnCount() const; + int row() const; + SmTreeItem *parent(); + QVariant data(int column) const; + void setData(int column, QVariant &data); + bool insertChild(int where, SmTreeItem *child); + bool removeChild(int where); + + private: + QList<SmTreeItem*> mChildren; + QList<QVariant> mData; + SmTreeItem *mParent; +}; + +#endif |