AutoTest: Redo evaluation of result summary items

By moving this functionality completely into the tree item
it is possible to eliminate superfluous enum values that
basically represented the same item but in different states.

Change-Id: I2e6b6462bbaae51bdf6822fde198aea36f951c7f
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2019-04-15 16:08:10 +02:00
parent 24cadba480
commit 0576e419e3
7 changed files with 112 additions and 74 deletions

View File

@@ -83,12 +83,14 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
painter->drawPixmap(positions.left(), positions.top(),
icon.pixmap(window, QSize(positions.iconSize(), positions.iconSize())));
QString typeStr = TestResult::resultToString(testResult->result());
TestResultItem *item = resultFilterModel->itemForIndex(index);
QTC_ASSERT(item, painter->restore(); return);
const QString typeStr = item->resultString();
if (selected) {
painter->drawText(positions.typeAreaLeft(), positions.top() + fm.ascent(), typeStr);
} else {
QPen tmp = painter->pen();
if (TestResult::isMessageCaseStart(testResult->result()))
if (testResult->result() == ResultType::TestStart)
painter->setPen(opt.palette.mid().color());
else
painter->setPen(TestResult::colorForType(testResult->result()));