Skip to content

Commit

Permalink
tweaks for symbolslist widget filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Arunmozhi committed Aug 4, 2012
1 parent 86143e9 commit cbd71fa
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/gui/symbology-ng/qgsstylev2managerdialog.cpp
Expand Up @@ -195,7 +195,6 @@ void QgsStyleV2ManagerDialog::populateSymbols( QStringList symbolNames, bool che
QStandardItemModel* model = qobject_cast<QStandardItemModel*>( listItems->model() );
model->clear();

// QStringList symbolNames = mStyle->symbolNames();
int type = currentItemType();

for ( int i = 0; i < symbolNames.count(); ++i )
Expand Down
13 changes: 11 additions & 2 deletions src/gui/symbology-ng/qgssymbolslistwidget.cpp
Expand Up @@ -297,8 +297,17 @@ void QgsSymbolsListWidget::setSymbolFromStyle( const QModelIndex & index )

void QgsSymbolsListWidget::on_groupsCombo_currentIndexChanged( const QString &text )
{
int groupid = mStyle->groupId( text );
QStringList symbols = mStyle->symbolsOfGroup( SymbolEntity, groupid );
QStringList symbols;
// List all symbols when empty list item is selected
if ( text.isEmpty() )
{
symbols = mStyle->symbolNames();
}
else
{
int groupid = mStyle->groupId( text );
symbols = mStyle->symbolsOfGroup( SymbolEntity, groupid );
}
populateSymbols( symbols );
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsstylev2managerdialogbase.ui
Expand Up @@ -111,7 +111,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<property name="iconSize">
<size>
Expand Down
12 changes: 12 additions & 0 deletions src/ui/symbollayer/widget_symbolslist.ui
Expand Up @@ -252,6 +252,18 @@
</item>
<item>
<widget class="QComboBox" name="groupsCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
Expand Down

0 comments on commit cbd71fa

Please sign in to comment.