Skip to content

Commit

Permalink
[style dock] fix wrong label settings when switching layers
Browse files Browse the repository at this point in the history
(fixes #17029)
  • Loading branch information
nirvn authored Oct 2, 2017
1 parent 5bdb605 commit 471204d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/qgslabelingwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ QgsLabelingWidget::QgsLabelingWidget( QgsVectorLayer *layer, QgsMapCanvas *canva

connect( mEngineSettingsButton, &QAbstractButton::clicked, this, &QgsLabelingWidget::showEngineConfigDialog );

mLabelModeComboBox->setCurrentIndex( -1 );

connect( mLabelModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLabelingWidget::labelModeChanged );
setLayer( layer );
}
Expand Down Expand Up @@ -81,6 +79,8 @@ void QgsLabelingWidget::adaptToLayer()
if ( !mLayer )
return;

whileBlocking( mLabelModeComboBox )->setCurrentIndex( -1 );

// pick the right mode of the layer
if ( mLayer->labeling() && mLayer->labeling()->type() == QLatin1String( "rule-based" ) )
{
Expand Down

0 comments on commit 471204d

Please sign in to comment.