Skip to content

Commit ac2c742

Browse files
committed
map layer combo: emit signal on setLayer even if index is not changed
1 parent 41ccfb9 commit ac2c742

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/gui/qgsmaplayercombobox.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ QgsMapLayerComboBox::QgsMapLayerComboBox( QWidget *parent ) :
2222
mProxyModel = new QgsMapLayerProxyModel( this );
2323
setModel( mProxyModel );
2424

25-
connect( this, SIGNAL( currentIndexChanged( int ) ), this, SLOT( indexChanged( int ) ) );
25+
connect( this, SIGNAL( activated( int ) ), this, SLOT( indexChanged( int ) ) );
2626
}
2727

2828
void QgsMapLayerComboBox::setFilters( QgsMapLayerProxyModel::Filters filters )
@@ -43,6 +43,8 @@ void QgsMapLayerComboBox::setLayer( QgsMapLayer *layer )
4343
}
4444
}
4545
setCurrentIndex( -1 );
46+
47+
emit layerChanged( currentLayer() );
4648
}
4749

4850
QgsMapLayer* QgsMapLayerComboBox::currentLayer()
@@ -75,5 +77,3 @@ void QgsMapLayerComboBox::indexChanged( int i )
7577
QgsMapLayer* layer = currentLayer();
7678
emit layerChanged( layer );
7779
}
78-
79-

0 commit comments

Comments
 (0)