diff options
author | Christian Stenger <christian.stenger@qt.io> | 2018-03-06 10:38:36 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2018-04-11 08:24:47 +0000 |
commit | 2945865516dbb16a4283183df01fdf12020a068a (patch) | |
tree | d69b967e61447473d4555e3ef897c71265fd7879 /src/plugins/autotest/quick | |
parent | d6bb6c501809fbf59fa574c3b97615d445c300e6 (diff) |
AutoTest: Provide possibility to copy tree items
This allows to create a copy of an item. Basically it will
copy its member objects, but it does not copy its children.
Preparation for extending grouping support for GTest.
Change-Id: I75f92be53ff4191cacea2944b31641a9292d1e58
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/autotest/quick')
-rw-r--r-- | src/plugins/autotest/quick/quicktesttreeitem.cpp | 7 | ||||
-rw-r--r-- | src/plugins/autotest/quick/quicktesttreeitem.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/autotest/quick/quicktesttreeitem.cpp b/src/plugins/autotest/quick/quicktesttreeitem.cpp index 6d3a2b99f48..da0978c149d 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.cpp +++ b/src/plugins/autotest/quick/quicktesttreeitem.cpp @@ -35,6 +35,13 @@ namespace Autotest { namespace Internal { +TestTreeItem *QuickTestTreeItem::copyWithoutChildren() +{ + QuickTestTreeItem *copied = new QuickTestTreeItem; + copied->copyBasicDataFrom(this); + return copied; +} + QVariant QuickTestTreeItem::data(int column, int role) const { switch (role) { diff --git a/src/plugins/autotest/quick/quicktesttreeitem.h b/src/plugins/autotest/quick/quicktesttreeitem.h index 30b5efd317b..88d21bf637c 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.h +++ b/src/plugins/autotest/quick/quicktesttreeitem.h @@ -36,6 +36,7 @@ public: explicit QuickTestTreeItem(const QString &name = QString(), const QString &filePath = QString(), Type type = Root) : TestTreeItem(name, filePath, type) {} + TestTreeItem *copyWithoutChildren() override; QVariant data(int column, int role) const override; Qt::ItemFlags flags(int column) const override; bool canProvideTestConfiguration() const override; |