diff options
author | Christian Stenger <christian.stenger@theqtcompany.com> | 2015-09-10 15:32:12 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@theqtcompany.com> | 2015-10-08 17:32:42 +0300 |
commit | 55f3dcb6b56ac77f64073f64a99467c5c16285df (patch) | |
tree | 6668c6546b54d7d293d9d6e11469ea01fd5e404a /plugins/autotest/testtreemodel.h | |
parent | 9a193f7a4c6d3a5a0a2b4174f31a581f9a15aea0 (diff) | |
download | qt-creator-55f3dcb6b56ac77f64073f64a99467c5c16285df.tar.gz |
Re-use QC's TreeItem/TreeModel for TestTreeItem/TestTreeModel
Change-Id: Ied35f808311392dcace1dca35796223369b37e0b
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'plugins/autotest/testtreemodel.h')
-rw-r--r-- | plugins/autotest/testtreemodel.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/plugins/autotest/testtreemodel.h b/plugins/autotest/testtreemodel.h index 83b6f89b18..5c51648ed5 100644 --- a/plugins/autotest/testtreemodel.h +++ b/plugins/autotest/testtreemodel.h @@ -24,7 +24,8 @@ #include <cplusplus/CppDocument.h> -#include <QAbstractItemModel> +#include <utils/treemodel.h> + #include <QSortFilterProxyModel> namespace Autotest { @@ -35,7 +36,7 @@ class TestCodeParser; class TestInfo; class TestTreeItem; -class TestTreeModel : public QAbstractItemModel +class TestTreeModel : public Utils::TreeModel { Q_OBJECT public: @@ -49,15 +50,8 @@ public: void enableParsing(); void disableParsing(); - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &index) const; - bool hasChildren(const QModelIndex &parent) 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; - bool setData(const QModelIndex &index, const QVariant &value, int role); - Qt::ItemFlags flags(const QModelIndex &index) const; - bool removeRows(int row, int count, const QModelIndex &parent); + bool setData(const QModelIndex &index, const QVariant &value, int role) override; + Qt::ItemFlags flags(const QModelIndex &index) const override; TestCodeParser *parser() const { return m_parser; } bool hasTests() const; @@ -98,7 +92,6 @@ private: void processChildren(QModelIndex &parentIndex, const TestTreeItem *newItem, const int upperBound, const QHash<QString, Qt::CheckState> &checkStates); - TestTreeItem *m_rootItem; TestTreeItem *m_autoTestRootItem; TestTreeItem *m_quickTestRootItem; TestCodeParser *m_parser; |