Fix #6214. Show names under symbols

This commit is contained in:
Nathan Woodrow 2012-12-28 21:44:13 +10:00
parent 9c91d31fbb
commit 837f1872fd
2 changed files with 10 additions and 2 deletions

View File

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

View File

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