diff options
author | hjk <hjk@theqtcompany.com> | 2015-01-07 14:13:53 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2015-01-12 12:16:49 +0100 |
commit | 7fd21d22ac099708645306b96560959f90294e65 (patch) | |
tree | 4b160f04fb1cc0c286366691e9511ebe82ae9e96 /src/plugins/projectexplorer/kitmodel.h | |
parent | e62e47f0d09b66d1934e5d1a363f08a0c34a2768 (diff) |
ProjectExplorer: Use Utils::TreeModel for KitModel
Simplifies code.
Change-Id: I3db07f8b0ffd980856e65abee856559a0a85dfdb
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Diffstat (limited to 'src/plugins/projectexplorer/kitmodel.h')
-rw-r--r-- | src/plugins/projectexplorer/kitmodel.h | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/plugins/projectexplorer/kitmodel.h b/src/plugins/projectexplorer/kitmodel.h index 80ac8b790b..bd4ef83893 100644 --- a/src/plugins/projectexplorer/kitmodel.h +++ b/src/plugins/projectexplorer/kitmodel.h @@ -33,7 +33,7 @@ #include "projectexplorer_export.h" -#include <QAbstractItemModel> +#include <utils/treemodel.h> QT_BEGIN_NAMESPACE class QBoxLayout; @@ -54,22 +54,12 @@ class KitNode; // KitModel: // -------------------------------------------------------------------------- -class KitModel : public QAbstractItemModel +class KitModel : public Utils::TreeModel { Q_OBJECT public: explicit KitModel(QBoxLayout *parentLayout, QObject *parent = 0); - ~KitModel(); - - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - Qt::ItemFlags flags(const QModelIndex &index) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; Kit *kit(const QModelIndex &); QModelIndex indexOf(Kit *k) const; @@ -95,19 +85,16 @@ private slots: void updateKit(ProjectExplorer::Kit *k); void removeKit(ProjectExplorer::Kit *k); void changeDefaultKit(); - void setDirty(); void validateKitNames(); private: QModelIndex index(KitNode *, int column = 0) const; KitNode *findWorkingCopy(Kit *k) const; - KitNode *createNode(KitNode *parent, Kit *k); + KitNode *createNode(Kit *k); void setDefaultNode(KitNode *node); - QList<Kit *> kitList(KitNode *node) const; - KitNode *m_root; - KitNode *m_autoRoot; - KitNode *m_manualRoot; + Utils::TreeItem *m_autoRoot; + Utils::TreeItem *m_manualRoot; QList<KitNode *> m_toRemoveList; |