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
8181 /** Return a pointer to the toolbox (where additional pages can be inserted) */
8282 virtual QToolBox* getToolBox()=0;
8383
84+ /** refresh legend of a layer */
85+ virtual void refreshLegend( QgsMapLayer * layer )=0;
86+
8487 signals:
8588 /** Emited whenever current (selected) layer changes.
8689 * 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()
140140{
141141 return qgis->toolBox ;
142142}
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
104104 /* * Return a pointer to the toolbox (where additional pages can be inserted) */
105105 virtual QToolBox* getToolBox ();
106106
107+ virtual void refreshLegend (QgsMapLayer *l);
108+
107109 private:
108110
109111 // / QgisInterface aren't copied
Original file line number Diff line number Diff line change @@ -113,6 +113,9 @@ class GUI_EXPORT QgisInterface : public QObject
113113 /* * Return a pointer to the toolbox (where additional pages can be inserted) */
114114 virtual QToolBox* getToolBox ()=0;
115115
116+ /* * refresh the legend of a layer */
117+ virtual void refreshLegend (QgsMapLayer *l)=0;
118+
116119 signals:
117120 /* * Emited whenever current (selected) layer changes.
118121 * The pointer to layer can be null if no layer is selected
You can’t perform that action at this time.
0 commit comments