Skip to content

Commit

Permalink
Check field subType for a fallback icon
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Sep 24, 2020
1 parent f3ae29d commit 69d66a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/qgsdataitem.cpp
Expand Up @@ -227,7 +227,13 @@ QgsFieldItem::~QgsFieldItem()

QIcon QgsFieldItem::icon()
{
return QgsFields::iconForFieldType( mField.type() );
const QIcon icon { QgsFields::iconForFieldType( mField.type() ) };
// Try subtype if icon is null
if ( icon.isNull() )
{
return QgsFields::iconForFieldType( mField.subType() );
}
return icon;
}

QIcon QgsFavoritesItem::iconFavorites()
Expand Down

0 comments on commit 69d66a1

Please sign in to comment.