Navigation Menu

Skip to content

Commit

Permalink
added currentLayerChanged
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5113 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Mar 29, 2006
1 parent 4031cc4 commit 8f011fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gui/qgisiface.cpp
Expand Up @@ -24,9 +24,12 @@
#include "qgisapp.h"
#include "qgsmaplayer.h"
#include "qgsmapcanvas.h"
#include "qgslegend.h"

QgisIface::QgisIface(QgisApp * _qgis, const char *name):qgis(_qgis)
{
connect ( qgis->legend(), SIGNAL(currentLayerChanged(QgsMapLayer *)),
this, SLOT(emitCurrentLayerChanged(QgsMapLayer *)) );

}

Expand Down Expand Up @@ -136,3 +139,9 @@ QgisIface::app()
{
return qgis;
} // QgisIface::app()

void QgisIface::emitCurrentLayerChanged ( QgsMapLayer * layer )
{
// Does not compile
//emit currentLayerChanged ( layer );
}
9 changes: 9 additions & 0 deletions src/gui/qgisiface.h
Expand Up @@ -104,6 +104,15 @@ class QgisIface : public QgisInterface{
*/
QgisApp * app();

public slots:
void emitCurrentLayerChanged ( QgsMapLayer * layer );


signals:
//! Emited whenever current (selected) layer changes
// the pointer to layer can be null if no layer is selected
void currentLayerChanged ( QgsMapLayer * layer );

private:

/// QgisIface aren't copied
Expand Down

0 comments on commit 8f011fc

Please sign in to comment.