Skip to content

Commit 2260780

Browse files
committedNov 20, 2016
[style manager] decrease font size and add name & tags tooltip
for the import/export symbol preview list
1 parent cc985c2 commit 2260780

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/gui/symbology-ng/qgsstyleexportimportdialog.cpp‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ QgsStyleExportImportDialog::QgsStyleExportImportDialog( QgsStyle* style, QWidget
5050
connect( pb, SIGNAL( clicked() ), this, SLOT( clearSelection() ) );
5151

5252
QStandardItemModel* model = new QStandardItemModel( listItems );
53-
5453
listItems->setModel( model );
5554
connect( listItems->selectionModel(), SIGNAL( selectionChanged( const QItemSelection&, const QItemSelection& ) ),
5655
this, SLOT( selectionChanged( const QItemSelection&, const QItemSelection& ) ) );
@@ -196,10 +195,16 @@ bool QgsStyleExportImportDialog::populateStyles( QgsStyle* style )
196195
for ( int i = 0; i < styleNames.count(); ++i )
197196
{
198197
name = styleNames[i];
198+
QStringList tags = style->tagsOfSymbol( QgsStyle::SymbolEntity, name );
199199
QgsSymbol* symbol = style->symbol( name );
200200
QStandardItem* item = new QStandardItem( name );
201201
QIcon icon = QgsSymbolLayerUtils::symbolPreviewIcon( symbol, listItems->iconSize(), 15 );
202202
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 );
203208
model->appendRow( item );
204209
delete symbol;
205210
}

0 commit comments

Comments
 (0)
Please sign in to comment.