Merge "Merge remote-tracking branch 'origin/4.6'"

This commit is contained in:
Eike Ziller
2018-02-01 10:13:42 +00:00
committed by The Qt Project
138 changed files with 1554 additions and 781 deletions

View File

@@ -55,13 +55,11 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
{
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
painter->save();
QFontMetrics fm(opt.font);
QBrush background;
QColor foreground;
const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(opt.widget);
const bool selected = opt.state & QStyle::State_Selected;
if (selected) {
@@ -71,10 +69,14 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
background = opt.palette.window().color();
foreground = opt.palette.text().color();
}
auto resultFilterModel = qobject_cast<const TestResultFilterModel *>(index.model());
if (!resultFilterModel)
return;
painter->save();
painter->fillRect(opt.rect, background);
painter->setPen(foreground);
TestResultFilterModel *resultFilterModel = static_cast<TestResultFilterModel *>(view->model());
LayoutPositions positions(opt, resultFilterModel);
const TestResult *testResult = resultFilterModel->testResult(index);
QTC_ASSERT(testResult, painter->restore();return);