Skip to content

Commit

Permalink
Fix rule based settings not saved (fix #15146, #15147, #15148)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 27, 2016
1 parent 0634377 commit c49af32
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
9 changes: 9 additions & 0 deletions python/gui/qgsscalerangewidget.sip
Expand Up @@ -37,4 +37,13 @@ class QgsScaleRangeWidget : QWidget
void setMaximumScale( double scale );

void setScaleRange( double min, double max );

signals:

/** Emitted when the scale range set in the widget is changed.
* @param min minimum scale
* @param max maximum scale
* @note added in QGIS 2.16
*/
void rangeChanged( double min, double max );
};
8 changes: 8 additions & 0 deletions src/gui/qgsscalerangewidget.cpp
Expand Up @@ -64,6 +64,9 @@ QgsScaleRangeWidget::QgsScaleRangeWidget( QWidget *parent )
mLayout->setColumnStretch( 3, 0 );
mLayout->setColumnStretch( 4, 0 );
mLayout->setColumnStretch( 5, 3 );

connect( mMinimumScaleWidget, SIGNAL( scaleChanged( double ) ), this, SLOT( emitRangeChanged() ) );
connect( mMaximumScaleWidget, SIGNAL( scaleChanged( double ) ), this, SLOT( emitRangeChanged() ) );
}

QgsScaleRangeWidget::~QgsScaleRangeWidget()
Expand Down Expand Up @@ -123,3 +126,8 @@ void QgsScaleRangeWidget::setScaleRange( double min, double max )
setMinimumScale( min );
}

void QgsScaleRangeWidget::emitRangeChanged()
{
emit rangeChanged( minimumScale(), maximumScale() );
}

13 changes: 13 additions & 0 deletions src/gui/qgsscalerangewidget.h
Expand Up @@ -62,6 +62,19 @@ class GUI_EXPORT QgsScaleRangeWidget : public QWidget

void setScaleRange( double min, double max );

signals:

/** Emitted when the scale range set in the widget is changed.
* @param min minimum scale
* @param max maximum scale
* @note added in QGIS 2.16
*/
void rangeChanged( double min, double max );

private slots:

void emitRangeChanged();

private:
//! pointer to the map canvas used for current buttons.
QgsMapCanvas* mCanvas;
Expand Down
6 changes: 5 additions & 1 deletion src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
Expand Up @@ -656,7 +656,11 @@ QgsRendererRulePropsWidget::QgsRendererRulePropsWidget( QgsRuleBasedRendererV2::
connect( btnExpressionBuilder, SIGNAL( clicked() ), this, SLOT( buildExpression() ) );
connect( btnTestFilter, SIGNAL( clicked() ), this, SLOT( testFilter() ) );
connect( editFilter, SIGNAL( textChanged( QString ) ), this, SIGNAL( widgetChanged() ) );

connect( editLabel, SIGNAL( textChanged( QString ) ), this, SIGNAL( widgetChanged() ) );
connect( editDescription, SIGNAL( textChanged( QString ) ), this, SIGNAL( widgetChanged() ) );
connect( groupSymbol, SIGNAL( toggled( bool ) ), this, SIGNAL( widgetChanged() ) );
connect( groupScale, SIGNAL( toggled( bool ) ), this, SIGNAL( widgetChanged() ) );
connect( mScaleRangeWidget, SIGNAL( rangeChanged( double, double ) ), this, SIGNAL( widgetChanged() ) );
}

QgsRendererRulePropsWidget::~QgsRendererRulePropsWidget()
Expand Down

0 comments on commit c49af32

Please sign in to comment.