Skip to content

Commit 837f187

Browse files
committed
Fix #6214. Show names under symbols
1 parent 9c91d31 commit 837f187

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/gui/symbology-ng/qgssymbolslistwidget.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,14 @@ void QgsSymbolsListWidget::populateSymbols( QStringList names )
157157
continue;
158158
}
159159
QStandardItem* item = new QStandardItem( names[i] );
160-
item->setData( names[i], Qt::UserRole ); //so we can show a label when it is clicked
161-
item->setText( "" ); //set the text to nothing and show in label when clicked rather
160+
item->setData( names[i], Qt::UserRole ); //so we can load symbol with that name
161+
item->setText( names[i] );
162+
item->setToolTip( names[i] );
162163
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
164+
// Set font to 10points to show reasonable text
165+
QFont itemFont = item->font();
166+
itemFont.setPointSize( 10 );
167+
item->setFont( itemFont );
163168
// create preview icon
164169
QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( s, previewSize );
165170
item->setIcon( icon );

src/ui/symbollayer/widget_symbolslist.ui

+3
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@
285285
<height>48</height>
286286
</size>
287287
</property>
288+
<property name="textElideMode">
289+
<enum>Qt::ElideNone</enum>
290+
</property>
288291
<property name="flow">
289292
<enum>QListView::LeftToRight</enum>
290293
</property>

0 commit comments

Comments
 (0)