diff --git a/src/core/locator/qgslocatormodel.cpp b/src/core/locator/qgslocatormodel.cpp index a77a8fea01b3..688a5b165266 100644 --- a/src/core/locator/qgslocatormodel.cpp +++ b/src/core/locator/qgslocatormodel.cpp @@ -16,6 +16,7 @@ ***************************************************************************/ #include +#include #include "qgslocatormodel.h" #include "moc_qgslocatormodel.cpp" @@ -115,10 +116,12 @@ QVariant QgsLocatorModel::data( const QModelIndex &index, int role ) const } case Qt::FontRole: - if ( index.column() == Name && !entry.groupTitle.isEmpty() ) + { + if ( index.column() == Name ) { QFont font; - font.setItalic( true ); + font.setBold( entry.type == EntryType::Filter ); + font.setItalic( entry.type == EntryType::Group ); return font; } else @@ -126,6 +129,18 @@ QVariant QgsLocatorModel::data( const QModelIndex &index, int role ) const return QVariant(); } break; + } + + case Qt::BackgroundRole: + { + return entry.type == EntryType::Result ? QPalette().base() : QPalette().alternateBase(); + } + + case Qt::ForegroundRole: + { + return QPalette().text(); + } + case Qt::DecorationRole: switch ( static_cast( index.column() ) )