summaryrefslogtreecommitdiffstats
path: root/mappingtreemodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'mappingtreemodel.h')
-rw-r--r--mappingtreemodel.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/mappingtreemodel.h b/mappingtreemodel.h
index a37e364..e55f609 100644
--- a/mappingtreemodel.h
+++ b/mappingtreemodel.h
@@ -39,6 +39,7 @@ class MappingTreeModel : public SmTreeModel {
bool deleteMappingType(int typeId);
bool addChild(const QVariant &name, const QModelIndex &parent);
bool deleteChild(const QModelIndex &idx);
+ int childCount(const QModelIndex &idx) const;
public slots:
void populate();
@@ -74,22 +75,23 @@ class MappingTreeModel : public SmTreeModel {
class MappingTreeResultModel : public SmTreeModel {
Q_OBJECT
public:
- enum Roles { NameRole = Qt::UserRole + 1 };
- enum Fields { Name = 0 };
- enum { NumFields = 1 };
+ enum Roles { NameRole = Qt::UserRole + 1, IdRole = Qt::UserRole + 2 };
+ enum Fields { Name = 0, Id = 1 };
+ enum { NumFields = 2 };
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);
+ QModelIndex insertChild(const QVariant &data, int id, SmTreeItem *parent);
+ QList<int> mappingsIds() const;
public slots:
void addItem(const MappingData &data);
-
private:
int hasChild(SmTreeItem *item, const QVariant &name, int column = 0) const;
+ QList<int> mappingIdsRecursive(SmTreeItem *parent) const;
};
struct MappingData {