Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 14, 2018
1 parent 8397517 commit 4beb321
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsvectorlayerlegendwidget.cpp
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology/qgssinglesymbolrenderer.cpp
Expand Up @@ -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 )
Expand Down

2 comments on commit 4beb321

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 4beb321 Jun 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Contributor

@nirvn nirvn commented on 4beb321 Jun 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.