From 55f3dcb6b56ac77f64073f64a99467c5c16285df Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 10 Sep 2015 15:32:12 +0200 Subject: Re-use QC's TreeItem/TreeModel for TestTreeItem/TestTreeModel Change-Id: Ied35f808311392dcace1dca35796223369b37e0b Reviewed-by: Niels Weber --- plugins/autotest/testtreemodel.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'plugins/autotest/testtreemodel.h') 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 -#include +#include + #include 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 &checkStates); - TestTreeItem *m_rootItem; TestTreeItem *m_autoTestRootItem; TestTreeItem *m_quickTestRootItem; TestCodeParser *m_parser; -- cgit v1.2.1