Skip to content
Permalink
Browse files

Fix setting a layer to act as a label obstacle does not stick

  • Loading branch information
nyalldawson committed Feb 15, 2016
1 parent 59b216b commit 6f2d11b56779f40ed0129bb1dfa640f9217ff5ef
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/app/qgslabelingwidget.cpp
@@ -97,7 +97,10 @@ void QgsLabelingWidget::labelModeChanged( int index )
if ( QgsLabelingGui* widgetSimple = qobject_cast<QgsLabelingGui*>( mWidget ) )
{
// lighter variant - just change the mode of existing widget
widgetSimple->setLabelMode( static_cast< QgsLabelingGui::LabelMode >( index ) );
if ( index == 3 )
widgetSimple->setLabelMode( QgsLabelingGui::ObstaclesOnly );
else
widgetSimple->setLabelMode( static_cast< QgsLabelingGui::LabelMode >( index ) );
return;
}
}
@@ -117,7 +120,12 @@ void QgsLabelingWidget::labelModeChanged( int index )
else
{
QgsLabelingGui* w = new QgsLabelingGui( mLayer, mCanvas, nullptr, this );
w->setLabelMode( static_cast< QgsLabelingGui::LabelMode >( index ) );

if ( index == 3 )
w->setLabelMode( QgsLabelingGui::ObstaclesOnly );
else
w->setLabelMode( static_cast< QgsLabelingGui::LabelMode >( index ) );

w->init();
mWidget = w;
}

0 comments on commit 6f2d11b

Please sign in to comment.
You can’t perform that action at this time.