Skip to content
Permalink
Browse files

Fix building of legend node tree if embedded widgets are used in the …

…layer

(cherry picked from commit 10cab93)
  • Loading branch information
wonder-sk committed Nov 1, 2016
1 parent 6b120a8 commit 90e1c9366141b768a1559e35e1337858724b59e4
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/core/layertree/qgslayertreemodel.cpp
@@ -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 = QStringLiteral( "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

0 comments on commit 90e1c93

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