summaryrefslogtreecommitdiff
path: root/plugins/autotest/testtreeitem.h
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@theqtcompany.com>2015-09-10 15:32:12 +0200
committerChristian Stenger <christian.stenger@theqtcompany.com>2015-10-08 17:32:42 +0300
commit55f3dcb6b56ac77f64073f64a99467c5c16285df (patch)
tree6668c6546b54d7d293d9d6e11469ea01fd5e404a /plugins/autotest/testtreeitem.h
parent9a193f7a4c6d3a5a0a2b4174f31a581f9a15aea0 (diff)
downloadqt-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/testtreeitem.h')
-rw-r--r--plugins/autotest/testtreeitem.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/plugins/autotest/testtreeitem.h b/plugins/autotest/testtreeitem.h
index 8a442e7f84..34ac137e04 100644
--- a/plugins/autotest/testtreeitem.h
+++ b/plugins/autotest/testtreeitem.h
@@ -20,14 +20,12 @@
#ifndef TESTTREEITEM_H
#define TESTTREEITEM_H
+#include <utils/treemodel.h>
+
#include <QList>
#include <QString>
#include <QMetaType>
-QT_BEGIN_NAMESPACE
-class QVariant;
-QT_END_NAMESPACE
-
namespace {
enum ItemRole {
LinkRole = Qt::UserRole + 2, // can be removed if AnnotationRole comes back
@@ -39,7 +37,7 @@ namespace {
namespace Autotest {
namespace Internal {
-class TestTreeItem
+class TestTreeItem : public Utils::TreeItem
{
public:
@@ -57,21 +55,12 @@ public:
virtual ~TestTreeItem();
TestTreeItem(const TestTreeItem& other);
- TestTreeItem *child(int row) const;
- TestTreeItem *parent() const;
- void appendChild(TestTreeItem *child);
- QVariant data(int column, int role) const;
- bool setData(int column, const QVariant &data, int role);
- int row() const;
- int childCount() const;
- void removeChildren();
- bool removeChild(int row);
+ virtual QVariant data(int column, int role) const override;
+ virtual bool setData(int column, const QVariant &data, int role) override;
bool modifyContent(const TestTreeItem *modified);
const QString name() const { return m_name; }
- void setName(const QString &name) { m_name = name; }
const QString filePath() const { return m_filePath; }
- void setFilePath(const QString &filePath) { m_filePath = filePath; }
void setLine(unsigned line) { m_line = line;}
unsigned line() const { return m_line; }
void setColumn(unsigned column) { m_column = column; }
@@ -82,6 +71,8 @@ public:
Qt::CheckState checked() const;
Type type() const { return m_type; }
QList<QString> getChildNames() const;
+ TestTreeItem *parentItem() const;
+ TestTreeItem *childItem(int row) const;
private:
void revalidateCheckState();
@@ -93,8 +84,6 @@ private:
unsigned m_line;
unsigned m_column;
QString m_mainFile;
- TestTreeItem *m_parent;
- QList<TestTreeItem *> m_children;
};
struct TestCodeLocationAndType {