Skip to content
Permalink
Browse files

fixed the empty group issue in symbol filter

  • Loading branch information
tecoholic committed Aug 4, 2012
1 parent fe50e11 commit 86143e9242b702973a5081cf17b955a9757515ba
Showing with 11 additions and 9 deletions.
  1. +9 −8 src/gui/symbology-ng/qgssymbolslistwidget.cpp
  2. +2 −1 src/gui/symbology-ng/qgssymbolslistwidget.h
@@ -51,6 +51,7 @@ QgsSymbolsListWidget::QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* sty

// Populate the symbol groups
QStringList groups = style->groupNames();
groupsCombo->addItem( QString( "" ) ); //empty first item
foreach ( QString group, groups )
{
groupsCombo->addItem( group );
@@ -100,7 +101,12 @@ QgsSymbolsListWidget::QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* sty
updateSymbolColor();
}

void QgsSymbolsListWidget::populateSymbolView( QStringList names )
void QgsSymbolsListWidget::populateSymbolView()
{
populateSymbols( mStyle->symbolNames() );
}

void QgsSymbolsListWidget::populateSymbols( QStringList names )
{
QSize previewSize = viewSymbols->iconSize();
QPixmap p( previewSize );
@@ -113,11 +119,6 @@ void QgsSymbolsListWidget::populateSymbolView( QStringList names )
}
model->clear();

if ( names.isEmpty() )
{
names = mStyle->symbolNames();
}

for ( int i = 0; i < names.count(); i++ )
{
QgsSymbolV2* s = mStyle->symbol( names[i] );
@@ -298,11 +299,11 @@ void QgsSymbolsListWidget::on_groupsCombo_currentIndexChanged( const QString &te
{
int groupid = mStyle->groupId( text );
QStringList symbols = mStyle->symbolsOfGroup( SymbolEntity, groupid );
populateSymbolView( symbols );
populateSymbols( symbols );
}

void QgsSymbolsListWidget::on_groupsCombo_editTextChanged( const QString &text )
{
QStringList symbols = mStyle->findSymbols( text );
populateSymbolView( symbols );
populateSymbols( symbols );
}
@@ -54,7 +54,8 @@ class GUI_EXPORT QgsSymbolsListWidget : public QWidget, private Ui::SymbolsListW
QgsSymbolV2* mSymbol;
QgsStyleV2* mStyle;

void populateSymbolView( QStringList symbols = QStringList() );
void populateSymbolView();
void populateSymbols( QStringList symbols );
void updateSymbolColor();
void updateSymbolInfo();

0 comments on commit 86143e9

Please sign in to comment.
You can’t perform that action at this time.