Skip to content

Commit fbdebd1

Browse files
committed
fix crash on opening symbol levels dialog when using categorized renderer with showClassifiers
1 parent 049f5ca commit fbdebd1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/gui/symbology-ng/qgssymbollevelsv2dialog.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,18 @@ QgsSymbolLevelsV2Dialog::QgsSymbolLevelsV2Dialog( QgsLegendSymbolList list, bool
7373

7474
connect( chkEnable, SIGNAL( clicked() ), this, SLOT( updateUi() ) );
7575

76+
if ( mList.count() > 0 && !mList[0].second )
77+
{
78+
// remove symbolless entry (probably classifier of categorized renderer)
79+
mList.removeFirst();
80+
}
81+
7682
int maxLayers = 0;
77-
tableLevels->setRowCount( list.count() );
78-
for ( int i = 0; i < list.count(); i++ )
83+
tableLevels->setRowCount( mList.count() );
84+
for ( int i = 0; i < mList.count(); i++ )
7985
{
80-
QgsSymbolV2* sym = list[i].second;
81-
QString label = list[i].first;
86+
QgsSymbolV2* sym = mList[i].second;
87+
QString label = mList[i].first;
8288

8389
// set icons for the rows
8490
QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( sym, QSize( 16, 16 ) );

0 commit comments

Comments
 (0)