Skip to content

Commit

Permalink
map layer combo: emit signal on setLayer even if index is not changed
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 6, 2014
1 parent 41ccfb9 commit ac2c742
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/qgsmaplayercombobox.cpp
Expand Up @@ -22,7 +22,7 @@ QgsMapLayerComboBox::QgsMapLayerComboBox( QWidget *parent ) :
mProxyModel = new QgsMapLayerProxyModel( this );
setModel( mProxyModel );

connect( this, SIGNAL( currentIndexChanged( int ) ), this, SLOT( indexChanged( int ) ) );
connect( this, SIGNAL( activated( int ) ), this, SLOT( indexChanged( int ) ) );
}

void QgsMapLayerComboBox::setFilters( QgsMapLayerProxyModel::Filters filters )
Expand All @@ -43,6 +43,8 @@ void QgsMapLayerComboBox::setLayer( QgsMapLayer *layer )
}
}
setCurrentIndex( -1 );

emit layerChanged( currentLayer() );
}

QgsMapLayer* QgsMapLayerComboBox::currentLayer()
Expand Down Expand Up @@ -75,5 +77,3 @@ void QgsMapLayerComboBox::indexChanged( int i )
QgsMapLayer* layer = currentLayer();
emit layerChanged( layer );
}


0 comments on commit ac2c742

Please sign in to comment.