forked from qt-creator/qt-creator
AutoTest: Fix auto expansion of Qt test results
..especially when using data driven tests. In this case we add an intermediate before the first data tag result which apparently never got automatically expanded. Change-Id: I282a57444b8014877c7a0e9f67c11c05ba1d06a5 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "testresultmodel.h"
|
||||
|
||||
#include "autotesticons.h"
|
||||
#include "testresultspane.h"
|
||||
#include "testrunner.h"
|
||||
#include "testsettings.h"
|
||||
#include "testtreeitem.h"
|
||||
@@ -14,6 +15,7 @@
|
||||
|
||||
#include <QFontMetrics>
|
||||
#include <QIcon>
|
||||
#include <QToolButton>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
@@ -184,6 +186,17 @@ TestResultItem *TestResultItem::createAndAddIntermediateFor(const TestResultItem
|
||||
result.setResult(ResultType::TestStart);
|
||||
TestResultItem *intermediate = new TestResultItem(result);
|
||||
appendChild(intermediate);
|
||||
// FIXME: make the expand button's state easier accessible
|
||||
auto widgets = TestResultsPane::instance()->toolBarWidgets();
|
||||
if (!widgets.empty()) {
|
||||
if (QToolButton *expand = qobject_cast<QToolButton *>(widgets.at(0))) {
|
||||
if (expand->isChecked()) {
|
||||
QMetaObject::invokeMethod(TestResultsPane::instance(),
|
||||
[intermediate] { intermediate->expand(); },
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
}
|
||||
return intermediate;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user