@@ -50,7 +50,6 @@ QgsStyleExportImportDialog::QgsStyleExportImportDialog( QgsStyle* style, QWidget
50
50
connect ( pb, SIGNAL ( clicked () ), this , SLOT ( clearSelection () ) );
51
51
52
52
QStandardItemModel* model = new QStandardItemModel ( listItems );
53
-
54
53
listItems->setModel ( model );
55
54
connect ( listItems->selectionModel (), SIGNAL ( selectionChanged ( const QItemSelection&, const QItemSelection& ) ),
56
55
this , SLOT ( selectionChanged ( const QItemSelection&, const QItemSelection& ) ) );
@@ -196,10 +195,16 @@ bool QgsStyleExportImportDialog::populateStyles( QgsStyle* style )
196
195
for ( int i = 0 ; i < styleNames.count (); ++i )
197
196
{
198
197
name = styleNames[i];
198
+ QStringList tags = style->tagsOfSymbol ( QgsStyle::SymbolEntity, name );
199
199
QgsSymbol* symbol = style->symbol ( name );
200
200
QStandardItem* item = new QStandardItem ( name );
201
201
QIcon icon = QgsSymbolLayerUtils::symbolPreviewIcon ( symbol, listItems->iconSize (), 15 );
202
202
item->setIcon ( icon );
203
+ item->setToolTip ( QString ( " <b>%1</b><br><i>%2</i>" ).arg ( name ).arg ( tags.count () > 0 ? tags.join ( " , " ) : tr ( " Not tagged" ) ) );
204
+ // Set font to 10points to show reasonable text
205
+ QFont itemFont = item->font ();
206
+ itemFont.setPointSize ( 10 );
207
+ item->setFont ( itemFont );
203
208
model->appendRow ( item );
204
209
delete symbol;
205
210
}
0 commit comments