forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/4.6'"
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user