summaryrefslogtreecommitdiffstats
path: root/mappingtreemodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'mappingtreemodel.h')
-rw-r--r--mappingtreemodel.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/mappingtreemodel.h b/mappingtreemodel.h
index 451ab83..a37e364 100644
--- a/mappingtreemodel.h
+++ b/mappingtreemodel.h
@@ -14,6 +14,8 @@
class QSqlQuery;
class SmTreeItem;
+class MappingData;
+class SmTreeItem;
class MappingTreeModel : public SmTreeModel {
Q_OBJECT
@@ -69,4 +71,31 @@ class MappingTreeModel : public SmTreeModel {
};
+class MappingTreeResultModel : public SmTreeModel {
+ Q_OBJECT
+ public:
+ enum Roles { NameRole = Qt::UserRole + 1 };
+ enum Fields { Name = 0 };
+ enum { NumFields = 1 };
+ explicit MappingTreeResultModel(const QStringList &headers, QObject *parent = 0);
+
+ //data + flags
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ bool setData(const QModelIndex &index, const QVariant &value, int role);
+ QModelIndex insertChild(const QVariant &data, SmTreeItem *parent);
+
+ public slots:
+ void addItem(const MappingData &data);
+
+
+ private:
+ int hasChild(SmTreeItem *item, const QVariant &name, int column = 0) const;
+};
+
+struct MappingData {
+ int id;
+ QString name;
+ QStringList path;
+};
+
#endif // MAPPINGTREEMODEL_H