File tree Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Expand file tree Collapse file tree 4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ class QgisInterface : QObject
81
81
/** Return a pointer to the toolbox (where additional pages can be inserted) */
82
82
virtual QToolBox* getToolBox()=0;
83
83
84
+ /** refresh legend of a layer */
85
+ virtual void refreshLegend( QgsMapLayer * layer )=0;
86
+
84
87
signals:
85
88
/** Emited whenever current (selected) layer changes.
86
89
* The pointer to layer can be null if no layer is selected
Original file line number Diff line number Diff line change @@ -140,3 +140,11 @@ QToolBox* QgisAppInterface::getToolBox()
140
140
{
141
141
return qgis->toolBox ;
142
142
}
143
+
144
+ void QgisAppInterface::refreshLegend (QgsMapLayer *l)
145
+ {
146
+ if (l && qgis && qgis->legend ())
147
+ {
148
+ qgis->legend ()->refreshLayerSymbology ( l->getLayerID () );
149
+ }
150
+ }
Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ class QgisAppInterface : public QgisInterface
104
104
/* * Return a pointer to the toolbox (where additional pages can be inserted) */
105
105
virtual QToolBox* getToolBox ();
106
106
107
+ virtual void refreshLegend (QgsMapLayer *l);
108
+
107
109
private:
108
110
109
111
// / QgisInterface aren't copied
Original file line number Diff line number Diff line change @@ -113,6 +113,9 @@ class GUI_EXPORT QgisInterface : public QObject
113
113
/* * Return a pointer to the toolbox (where additional pages can be inserted) */
114
114
virtual QToolBox* getToolBox ()=0;
115
115
116
+ /* * refresh the legend of a layer */
117
+ virtual void refreshLegend (QgsMapLayer *l)=0;
118
+
116
119
signals:
117
120
/* * Emited whenever current (selected) layer changes.
118
121
* The pointer to layer can be null if no layer is selected
You can’t perform that action at this time.
0 commit comments