ProjectTree: Do not use disabled state for disabled nodes

Rendering disabled nodes using the disabled state in the painter
breaks themes as it introduces a discrepancy between the actual
state of the node and its graphical representation.

IIRC this was introduced since there was no easy way to find what
color was supposed to be used for disabled items. That is no longer
the case, so let's clean this up.

Change-Id: Ic5653cd970e07eb680cb1d28d1feefd70aded540
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Tobias Hunger
2018-03-22 10:13:19 +01:00
parent e760cbdd52
commit f7a0a3cd26
4 changed files with 11 additions and 9 deletions

View File

@@ -93,12 +93,10 @@ public:
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
{
QStyleOptionViewItem opt = option;
if (!index.data(Project::EnabledRole).toBool())
opt.state &= ~QStyle::State_Enabled;
QStyledItemDelegate::paint(painter, opt, index);
QStyledItemDelegate::paint(painter, option, index);
if (index.data(Project::isParsingRole).toBool()) {
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
ProgressIndicatorPainter *indicator = findOrCreateIndicatorPainter(index);