Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #6214. Show names under symbols
  • Loading branch information
NathanW2 committed Dec 28, 2012
1 parent 9c91d31 commit 837f187
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gui/symbology-ng/qgssymbolslistwidget.cpp
Expand Up @@ -157,9 +157,14 @@ void QgsSymbolsListWidget::populateSymbols( QStringList names )
continue;
}
QStandardItem* item = new QStandardItem( names[i] );
item->setData( names[i], Qt::UserRole ); //so we can show a label when it is clicked
item->setText( "" ); //set the text to nothing and show in label when clicked rather
item->setData( names[i], Qt::UserRole ); //so we can load symbol with that name
item->setText( names[i] );
item->setToolTip( names[i] );
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
// Set font to 10points to show reasonable text
QFont itemFont = item->font();
itemFont.setPointSize( 10 );
item->setFont( itemFont );
// create preview icon
QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( s, previewSize );
item->setIcon( icon );
Expand Down
3 changes: 3 additions & 0 deletions src/ui/symbollayer/widget_symbolslist.ui
Expand Up @@ -285,6 +285,9 @@
<height>48</height>
</size>
</property>
<property name="textElideMode">
<enum>Qt::ElideNone</enum>
</property>
<property name="flow">
<enum>QListView::LeftToRight</enum>
</property>
Expand Down

0 comments on commit 837f187

Please sign in to comment.