forked from qt-creator/qt-creator
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:
@@ -298,9 +298,8 @@ void TestResultModel::addTestResult(const TestResult &testResult, bool autoExpan
|
|||||||
if (parentItem) {
|
if (parentItem) {
|
||||||
parentItem->appendChild(newItem);
|
parentItem->appendChild(newItem);
|
||||||
if (autoExpand) {
|
if (autoExpand) {
|
||||||
parentItem->expand();
|
QMetaObject::invokeMethod(this, [parentItem]{ parentItem->expand(); },
|
||||||
newItem->expand();
|
Qt::QueuedConnection);
|
||||||
newItem->forAllChildren([](TreeItem *it) { it->expand(); });
|
|
||||||
}
|
}
|
||||||
updateParent(newItem);
|
updateParent(newItem);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ TestResultsPane::TestResultsPane(QObject *parent) :
|
|||||||
onCopyItemTriggered(getTestResult(m_treeView->currentIndex()));
|
onCopyItemTriggered(getTestResult(m_treeView->currentIndex()));
|
||||||
});
|
});
|
||||||
connect(m_model, &TestResultModel::requestExpansion, this, [this](const QModelIndex &idx) {
|
connect(m_model, &TestResultModel::requestExpansion, this, [this](const QModelIndex &idx) {
|
||||||
m_treeView->expand(m_filterModel->mapFromSource(idx));
|
m_treeView->expandRecursively(m_filterModel->mapFromSource(idx));
|
||||||
});
|
});
|
||||||
connect(TestRunner::instance(), &TestRunner::testRunStarted,
|
connect(TestRunner::instance(), &TestRunner::testRunStarted,
|
||||||
this, &TestResultsPane::onTestRunStarted);
|
this, &TestResultsPane::onTestRunStarted);
|
||||||
|
|||||||
Reference in New Issue
Block a user