Skip to content

Commit

Permalink
Fix building of legend node tree if embedded widgets are used in the …
Browse files Browse the repository at this point in the history
…layer
  • Loading branch information
wonder-sk committed Oct 20, 2016
1 parent b385ebd commit 10cab93
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/layertree/qgslayertreemodel.cpp
Expand Up @@ -44,13 +44,20 @@ class EmbeddedWidgetLegendNode : public QgsLayerTreeModelLegendNode
EmbeddedWidgetLegendNode( QgsLayerTreeLayer* nodeL )
: QgsLayerTreeModelLegendNode( nodeL )
{
// we need a valid rule key to allow the model to build a tree out of legend nodes
// if that's possible (if there is a node without a rule key, building of tree is cancelled)
mRuleKey = "embedded-widget-" + QUuid::createUuid().toString();
}

virtual QVariant data( int role ) const override
{
Q_UNUSED( role );
if ( role == RuleKeyRole )
return mRuleKey;
return QVariant();
}

private:
QString mRuleKey;
};

///@endcond
Expand Down

0 comments on commit 10cab93

Please sign in to comment.