ScxmlEditor: Make the Attribute Editor table themable

...by not using hardcoded colors.

Task-number: QTCREATORBUG-18685
Change-Id: Idbe694b4112cb2c7d82738598fb04c68c510c609
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
Alessandro Portale
2017-08-08 19:14:29 +02:00
parent 3a195ffb9a
commit 8507f6ae55

View File

@@ -117,8 +117,6 @@ QVariant SCAttributeItemModel::data(const QModelIndex &index, int role) const
return Qt::AlignHCenter; return Qt::AlignHCenter;
else else
break; break;
case Qt::ForegroundRole:
return bExtraRow ? QBrush(Qt::gray) : QBrush(Qt::black);
case DataTypeRole: { case DataTypeRole: {
if (m_tag->tagType() == Metadata || m_tag->tagType() == MetadataItem) if (m_tag->tagType() == Metadata || m_tag->tagType() == MetadataItem)
return (int)QVariant::String; return (int)QVariant::String;
@@ -148,7 +146,7 @@ Qt::ItemFlags SCAttributeItemModel::flags(const QModelIndex &index) const
if (m_tag->tagType() <= MetadataItem || (index.column() == 1 && m_tag->info()->n_attributes > 0 && m_tag->info()->attributes[index.row()].editable)) if (m_tag->tagType() <= MetadataItem || (index.column() == 1 && m_tag->info()->n_attributes > 0 && m_tag->info()->attributes[index.row()].editable))
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable; return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
return Qt::NoItemFlags; return index.column() == 0 ? Qt::ItemIsEnabled : Qt::NoItemFlags;
} }
int SCAttributeItemModel::columnCount(const QModelIndex &parent) const int SCAttributeItemModel::columnCount(const QModelIndex &parent) const