Let TestTreeItem handle its parent

Part of preparing to re-use QC's TreeModel/TreeItem for
TestTreeModel/TestTreeItem.

Change-Id: Ieab26e9061790dd4c3d8dc64ce292727a17977f7
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-09-04 11:02:14 +02:00
parent 0d01a0c7bf
commit b4dcfc1d91
4 changed files with 17 additions and 20 deletions

View File

@@ -398,7 +398,7 @@ static TestTreeItem constructTestTreeItem(const QString &fileName,
foreach (const QString &functionName, functions.keys()) {
const TestCodeLocationAndType locationAndType = functions.value(functionName);
TestTreeItem *treeItemChild = new TestTreeItem(functionName, locationAndType.m_name,
locationAndType.m_type, &treeItem);
locationAndType.m_type);
treeItemChild->setLine(locationAndType.m_line);
treeItemChild->setColumn(locationAndType.m_column);
// check for data tags and if there are any for this function add them
@@ -408,7 +408,7 @@ static TestTreeItem constructTestTreeItem(const QString &fileName,
foreach (const TestCodeLocationAndType &tagLocation, tags) {
TestTreeItem *tagTreeItem = new TestTreeItem(tagLocation.m_name,
locationAndType.m_name,
tagLocation.m_type, treeItemChild);
tagLocation.m_type);
tagTreeItem->setLine(tagLocation.m_line);
tagTreeItem->setColumn(tagLocation.m_column);
treeItemChild->appendChild(tagTreeItem);