Skip to content
Permalink
Browse files

Fix broken apply button in label config dialog (fix #13543)

  • Loading branch information
nyalldawson committed Oct 14, 2015
1 parent fdbdd78 commit f50e1a757ada9b4aef7b8f90145f5a2d336056c9
Showing with 15 additions and 1 deletion.
  1. +1 −1 src/app/qgisapp.cpp
  2. +11 −0 src/app/qgslabelingwidget.cpp
  3. +3 −0 src/app/qgslabelingwidget.h
@@ -5237,7 +5237,7 @@ void QgisApp::labeling()

connect( buttonBox->button( QDialogButtonBox::Ok ), SIGNAL( clicked() ), &dlg, SLOT( accept() ) );
connect( buttonBox->button( QDialogButtonBox::Cancel ), SIGNAL( clicked() ), &dlg, SLOT( reject() ) );
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), labelingGui, SLOT( writeSettingsToLayer() ) );
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), labelingGui, SLOT( apply() ) );

if ( dlg.exec() )
{
@@ -4,6 +4,7 @@
#include "qgslabelinggui.h"
#include "qgsrulebasedlabelingwidget.h"
#include "qgsvectorlayerlabeling.h"
#include "qgisapp.h"

QgsLabelingWidget::QgsLabelingWidget( QgsVectorLayer* layer, QgsMapCanvas* canvas, QWidget* parent )
: QWidget( parent )
@@ -54,6 +55,16 @@ void QgsLabelingWidget::writeSettingsToLayer()
}
}

void QgsLabelingWidget::apply()
{
writeSettingsToLayer();
QgisApp::instance()->markDirty();
// trigger refresh
if ( mCanvas )
{
mCanvas->refresh();
}
}

void QgsLabelingWidget::labelModeChanged( int index )
{
@@ -23,6 +23,9 @@ class QgsLabelingWidget : public QWidget, private Ui::QgsLabelingWidget
//! save config to layer
void writeSettingsToLayer();

//! Saves the labeling configuration and immediately updates the map canvas to reflect the changes
void apply();

protected slots:
void labelModeChanged( int index );
void showEngineConfigDialog();

0 comments on commit f50e1a7

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