Skip to content

Commit

Permalink
added currentLayerChanged signal
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5111 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Mar 29, 2006
1 parent 07508ab commit 17e39b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/legend/qgslegend.cpp
Expand Up @@ -87,14 +87,16 @@ QgsLegend::~QgsLegend()

void QgsLegend::handleCurrentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous)
{
QgsMapLayer *layer = currentLayer();
if(mApp)
{
mApp->activateDeactivateLayerRelatedActions(currentLayer());
mApp->activateDeactivateLayerRelatedActions( layer );
}
if(mMapCanvas)
{
mMapCanvas->setCurrentLayer(currentLayer());
mMapCanvas->setCurrentLayer( layer );
}
emit currentLayerChanged ( layer );
}

void QgsLegend::addGroup()
Expand Down
3 changes: 3 additions & 0 deletions src/legend/qgslegend.h
Expand Up @@ -327,5 +327,8 @@ this item may be moved back to the original position with resetToInitialPosition
signals:
void zOrderChanged(QgsLegend * lv);

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

0 comments on commit 17e39b8

Please sign in to comment.