Skip to content
Permalink
Browse files

Fix text on symbol disappearing from single symbol renderer

Because the single symbol was not having rule key in legend...
  • Loading branch information
wonder-sk committed Jun 13, 2018
1 parent 8397517 commit 4beb3211e2a69f0c3691a2245c6534a029f53df6
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/app/qgsvectorlayerlegendwidget.cpp
  2. +2 −2 src/core/symbology/qgssinglesymbolrenderer.cpp
@@ -106,7 +106,7 @@ void QgsVectorLayerLegendWidget::populateLegendTreeView( const QHash<QString, QS
if ( symbolItem.ruleKey().isEmpty() )
{
item1->setEnabled( false );
item2->setEnabled( true );
item2->setEnabled( false );
}
else
{
@@ -312,15 +312,15 @@ QgsLegendSymbolList QgsSingleSymbolRenderer::legendSymbolItems() const
}

QgsLegendSymbolList lst;
lst << QgsLegendSymbolItem( mSymbol.get(), QString(), QString() );
lst << QgsLegendSymbolItem( mSymbol.get(), QString(), QStringLiteral( "0" ) );
return lst;
}

QSet< QString > QgsSingleSymbolRenderer::legendKeysForFeature( const QgsFeature &feature, QgsRenderContext &context ) const
{
Q_UNUSED( feature );
Q_UNUSED( context );
return QSet< QString >() << QString();
return QSet< QString >() << QStringLiteral( "0" );
}

void QgsSingleSymbolRenderer::setLegendSymbolItem( const QString &key, QgsSymbol *symbol )

2 comments on commit 4beb321

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn replied Jun 15, 2018

@wonder-sk , this created a regression; rule-based rules aren't shown in the layers panel anymore when a layer is placed in a group.

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn replied Jun 15, 2018

@wonder-sk , sorry, the regression emerged prior to this commit. Dissecting now.

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