Skip to content

Commit

Permalink
Fix broken apply button in label config dialog (fix #13543)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 14, 2015
1 parent fdbdd78 commit f50e1a7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -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() )
{
Expand Down
11 changes: 11 additions & 0 deletions src/app/qgslabelingwidget.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
{
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgslabelingwidget.h
Expand Up @@ -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();
Expand Down

0 comments on commit f50e1a7

Please sign in to comment.