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>
This commit is contained in:
Christian Stenger
2018-03-06 10:38:36 +01:00
parent d6bb6c5018
commit 2945865516
8 changed files with 42 additions and 0 deletions

View File

@@ -314,6 +314,20 @@ QSet<QString> TestTreeItem::internalTargets() const
return targets;
}
void TestTreeItem::copyBasicDataFrom(const TestTreeItem *other)
{
if (!other)
return;
m_name = other->m_name;
m_filePath = other->m_filePath;
m_type = other->m_type;
m_checked = other->m_checked;
m_line = other->m_line;
m_column = other->m_column;
m_proFile = other->m_proFile;
m_status = other->m_status;
}
inline bool TestTreeItem::modifyFilePath(const QString &filePath)
{
if (m_filePath != filePath) {