Skip to content

Commit ceb9e5e

Browse files
author
wonder
committed
Added missing connection to legend to trigger signals of group moves.
git-svn-id: http://svn.osgeo.org/qgis/trunk@12360 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 94317ce commit ceb9e5e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/app/legend/qgsapplegendinterface.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
QgsAppLegendInterface::QgsAppLegendInterface( QgsLegend * legend )
2424
: mLegend( legend )
2525
{
26+
connect( legend, SIGNAL( itemMoved( QModelIndex, QModelIndex ) ), this, SLOT( updateIndex( QModelIndex, QModelIndex ) ) );
2627
}
2728

2829
QgsAppLegendInterface::~QgsAppLegendInterface()
@@ -44,7 +45,7 @@ void QgsAppLegendInterface::moveLayer( QgsMapLayer * ml, int groupIndex )
4445
mLegend->moveLayer( ml, groupIndex );
4546
}
4647

47-
void QgsAppLegendInterface::updateIndex( const QModelIndex &oldIndex, const QModelIndex& newIndex)
48+
void QgsAppLegendInterface::updateIndex( QModelIndex oldIndex, QModelIndex newIndex )
4849
{
4950
if ( mLegend->isLegendGroup( newIndex ) )
5051
{

src/app/legend/qgsapplegendinterface.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
#include "qgslegendinterface.h"
2222

23-
class QModelIndex;
23+
#include <QModelIndex>
24+
2425
class QgsLegend;
2526
class QgsMapLayer;
2627

@@ -55,7 +56,7 @@ class QgsAppLegendInterface : public QgsLegendInterface
5556
void moveLayer( QgsMapLayer * ml, int groupIndex );
5657

5758
//! Update an index
58-
void updateIndex( const QModelIndex &oldIndex, const QModelIndex &newIndex );
59+
void updateIndex( QModelIndex oldIndex, QModelIndex newIndex );
5960

6061
private:
6162

0 commit comments

Comments
 (0)