We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent b385ebd commit 10cab93Copy full SHA for 10cab93
src/core/layertree/qgslayertreemodel.cpp
@@ -44,13 +44,20 @@ class EmbeddedWidgetLegendNode : public QgsLayerTreeModelLegendNode
44
EmbeddedWidgetLegendNode( QgsLayerTreeLayer* nodeL )
45
: QgsLayerTreeModelLegendNode( nodeL )
46
{
47
+ // we need a valid rule key to allow the model to build a tree out of legend nodes
48
+ // if that's possible (if there is a node without a rule key, building of tree is cancelled)
49
+ mRuleKey = "embedded-widget-" + QUuid::createUuid().toString();
50
}
51
52
virtual QVariant data( int role ) const override
53
- Q_UNUSED( role );
54
+ if ( role == RuleKeyRole )
55
+ return mRuleKey;
56
return QVariant();
57
58
+
59
+ private:
60
+ QString mRuleKey;
61
};
62
63
///@endcond
0 commit comments