AutoTest: Fix auto expansion of test results

We may add items that have sub-items already, so apply
the expansion to them as well if necessary.

Change-Id: Ibff4433c5a7c0a110461e46998cd39864f4ec929
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-07-09 09:14:03 +02:00
parent 9d16d735ab
commit ec65d43b65

View File

@@ -289,8 +289,11 @@ void TestResultModel::addTestResult(const TestResultPtr &testResult, bool autoEx
addFileName(testResult->fileName()); // ensure we calculate the results pane correctly addFileName(testResult->fileName()); // ensure we calculate the results pane correctly
if (parentItem) { if (parentItem) {
parentItem->appendChild(newItem); parentItem->appendChild(newItem);
if (autoExpand) if (autoExpand) {
parentItem->expand(); parentItem->expand();
newItem->expand();
newItem->forAllChildren([](Utils::TreeItem *it) { it->expand(); });
}
updateParent(newItem); updateParent(newItem);
} else { } else {
if (lastRow >= 0) { if (lastRow >= 0) {