File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 24
24
#include " qgisapp.h"
25
25
#include " qgsmaplayer.h"
26
26
#include " qgsmapcanvas.h"
27
+ #include " qgslegend.h"
27
28
28
29
QgisIface::QgisIface (QgisApp * _qgis, const char *name):qgis(_qgis)
29
30
{
31
+ connect ( qgis->legend (), SIGNAL (currentLayerChanged (QgsMapLayer *)),
32
+ this , SLOT (emitCurrentLayerChanged (QgsMapLayer *)) );
30
33
31
34
}
32
35
@@ -136,3 +139,9 @@ QgisIface::app()
136
139
{
137
140
return qgis;
138
141
} // QgisIface::app()
142
+
143
+ void QgisIface::emitCurrentLayerChanged ( QgsMapLayer * layer )
144
+ {
145
+ // Does not compile
146
+ // emit currentLayerChanged ( layer );
147
+ }
Original file line number Diff line number Diff line change @@ -104,6 +104,15 @@ class QgisIface : public QgisInterface{
104
104
*/
105
105
QgisApp * app ();
106
106
107
+ public slots:
108
+ void emitCurrentLayerChanged ( QgsMapLayer * layer );
109
+
110
+
111
+ signals:
112
+ // ! Emited whenever current (selected) layer changes
113
+ // the pointer to layer can be null if no layer is selected
114
+ void currentLayerChanged ( QgsMapLayer * layer );
115
+
107
116
private:
108
117
109
118
// / QgisIface aren't copied
You can’t perform that action at this time.
0 commit comments