Skip to content

Commit 2a827fb

Browse files
author
mhugent
committedJul 30, 2007
applied patch from Juergen to refresh layer legend from plugin
git-svn-id: http://svn.osgeo.org/qgis/trunk@7112 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6849f37 commit 2a827fb

File tree

5 files changed

+16
-0
lines changed

5 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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,8 @@ QToolBox* QgisAppInterface::getToolBox()
140140
{
141141
return qgis->toolBox;
142142
}
143+
144+
void QgisAppInterface::refreshLegend(QgsMapLayer *l)
145+
{
146+
qgis->legend()->refreshLayerSymbology(l->getLayerID());
147+
}

‎src/app/qgisappinterface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ class QgisAppInterface : public QgisInterface
104104
/** Return a pointer to the toolbox (where additional pages can be inserted) */
105105
virtual QToolBox* getToolBox();
106106

107+
/** refresh the legend of a layer */
108+
virtual void refreshLegend(QgsMapLayer *l);
109+
107110
private:
108111

109112
/// 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

‎src/gui/qgsmapcanvas.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,8 @@ void QgsMapCanvas::updateMap()
10171017
// XXX updating is not possible since we're already in paint loop
10181018
// mCanvas->update();
10191019
// QApplication::processEvents();
1020+
QPainter p(this);
1021+
p.drawPixmap(0, 0, mMap->pixmap());
10201022
}
10211023

10221024

0 commit comments

Comments
 (0)
Please sign in to comment.