File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,9 @@ void QgsComposerMapWidget::followVisibilityPresetSelected( int currentIndex )
332
332
if ( !mComposerMap )
333
333
return ;
334
334
335
+ if ( currentIndex == -1 )
336
+ return ; // doing combo box model reset
337
+
335
338
QString presetName;
336
339
if ( currentIndex != 0 )
337
340
{
@@ -378,6 +381,12 @@ void QgsComposerMapWidget::onPresetsChanged()
378
381
lst.append ( tr ( " (none)" ) );
379
382
lst += QgsProject::instance ()->visibilityPresetCollection ()->presets ();
380
383
model->setStringList ( lst );
384
+
385
+ // select the previously selected item again
386
+ int presetModelIndex = mFollowVisibilityPresetCombo ->findText ( mComposerMap ->followVisibilityPresetName () );
387
+ mFollowVisibilityPresetCombo ->blockSignals ( true );
388
+ mFollowVisibilityPresetCombo ->setCurrentIndex ( presetModelIndex != -1 ? presetModelIndex : 0 ); // 0 == none
389
+ mFollowVisibilityPresetCombo ->blockSignals ( false );
381
390
}
382
391
}
383
392
@@ -840,6 +849,8 @@ void QgsComposerMapWidget::blockAllSignals( bool b )
840
849
mAtlasMarginSpinBox ->blockSignals ( b );
841
850
mAtlasFixedScaleRadio ->blockSignals ( b );
842
851
mAtlasMarginRadio ->blockSignals ( b );
852
+ mFollowVisibilityPresetCheckBox ->blockSignals ( b );
853
+ mFollowVisibilityPresetCombo ->blockSignals ( b );
843
854
mKeepLayerListCheckBox ->blockSignals ( b );
844
855
mKeepLayerStylesCheckBox ->blockSignals ( b );
845
856
mSetToMapCanvasExtentButton ->blockSignals ( b );
You can’t perform that action at this time.
0 commit comments