AutoTest: Delay expansion request

Do not directly expand an item directly after it had
been added to the model as its internal mappings need
to get updated.

Fixes: QTCREATORBUG-29302
Change-Id: If70d209074d97e0598bcbce061e176148751705a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2023-06-22 15:22:35 +02:00
parent 150ca56067
commit 65b1088a17
2 changed files with 3 additions and 4 deletions

View File

@@ -298,9 +298,8 @@ void TestResultModel::addTestResult(const TestResult &testResult, bool autoExpan
if (parentItem) {
parentItem->appendChild(newItem);
if (autoExpand) {
parentItem->expand();
newItem->expand();
newItem->forAllChildren([](TreeItem *it) { it->expand(); });
QMetaObject::invokeMethod(this, [parentItem]{ parentItem->expand(); },
Qt::QueuedConnection);
}
updateParent(newItem);
} else {