Skip to content

Commit bced26a

Browse files
author
mhugent
committedOct 24, 2007
Applied patch for legend refresh from plugins provided by Juergen
git-svn-id: http://svn.osgeo.org/qgis/trunk@7296 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a46d1b4 commit bced26a

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed
 

‎python/gui/qgisinterface.sip

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

‎src/app/qgisappinterface.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

‎src/app/qgisappinterface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

‎src/gui/qgisinterface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)
Please sign in to comment.