Skip to content

Commit

Permalink
Merge pull request #60763 from qgis/backport-60689-to-queued_ltr_back…
Browse files Browse the repository at this point in the history
…ports

[Backport queued_ltr_backports] improve locator titles and groups visibility
  • Loading branch information
alexbruy authored Feb 26, 2025
2 parents ab54c3b + afa28be commit 424993e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/core/locator/qgslocatormodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
***************************************************************************/

#include <QFont>
#include <QPalette>

#include "qgslocatormodel.h"
#include "moc_qgslocatormodel.cpp"
Expand Down Expand Up @@ -115,17 +116,31 @@ 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
{
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<Column>( index.column() ) )
Expand Down

0 comments on commit 424993e

Please sign in to comment.