Check field subType for a fallback icon

This commit is contained in:
Alessandro Pasotti 2020-09-22 11:26:59 +02:00 committed by Nyall Dawson
parent f3ae29d973
commit 69d66a121d

View File

@ -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()