AutoTest: Make delegate independent from sub-classes...

...of TestTreeItem.

Change-Id: Ieacaeff64dced5e2a4dd3bd3a853cfb1081f5146
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Christian Stenger
2016-04-29 11:15:14 +02:00
parent f429b95b0e
commit 70394b29af
3 changed files with 8 additions and 8 deletions

View File

@@ -25,7 +25,6 @@
#include "testtreeitem.h"
#include "testtreeitemdelegate.h"
#include "testtreemodel.h"
#include <QPainter>
@@ -70,8 +69,8 @@ void TestTreeItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
}
}
// paint disabled googletests in gray
if (index.data(StateRole).toInt() & GoogleTestTreeItem::Disabled)
// paint disabled items in gray
if (!index.data(EnabledRole).toBool())
opt.palette.setColor(QPalette::Text, QColor(0xa0, 0xa0, 0xa0));
QStyledItemDelegate::paint(painter, opt, index);