From e63da8809091937d9acb867ab2883c016d6c40fe Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Thu, 26 Oct 2017 16:30:44 +0200 Subject: [PATCH] NULL value is gray and italic --- src/core/qgsfeaturefiltermodel.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/qgsfeaturefiltermodel.cpp b/src/core/qgsfeaturefiltermodel.cpp index a466d2d14598..30e0b18a3339 100644 --- a/src/core/qgsfeaturefiltermodel.cpp +++ b/src/core/qgsfeaturefiltermodel.cpp @@ -136,6 +136,22 @@ QVariant QgsFeatureFilterModel::data( const QModelIndex &index, int role ) const case IdentifierValueRole: return mEntries.value( index.row() ).identifierValue; + + case Qt::ForegroundRole: + if ( mEntries.value( index.row() ).identifierValue.isNull() ) + { + return QBrush( QColor( Qt::gray ) ); + } + break; + + case Qt::FontRole: + if ( mEntries.value( index.row() ).identifierValue.isNull() ) + { + QFont font = QFont(); + font.setItalic( true ); + return font; + } + break; } return QVariant();