Skip to content

Commit

Permalink
[composer] Don't update atlas filter until editing finished, prevente…
Browse files Browse the repository at this point in the history
…d, prevents errors while creating filter expression
  • Loading branch information
nyalldawson committed Jan 7, 2014
1 parent 22514b6 commit 9c5bbb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/app/composer/qgsatlascompositionwidget.cpp
Expand Up @@ -404,15 +404,15 @@ void QgsAtlasCompositionWidget::on_mAtlasFeatureFilterCheckBox_stateChanged( int
updateAtlasFeatures();
}

void QgsAtlasCompositionWidget::on_mAtlasFeatureFilterEdit_textChanged( const QString& text )
void QgsAtlasCompositionWidget::on_mAtlasFeatureFilterEdit_editingFinished()
{
QgsAtlasComposition* atlasMap = &mComposition->atlasComposition();
if ( !atlasMap )
{
return;
}

atlasMap->setFeatureFilter( text );
atlasMap->setFeatureFilter( mAtlasFeatureFilterEdit->text() );
updateAtlasFeatures();
}

Expand All @@ -431,8 +431,9 @@ void QgsAtlasCompositionWidget::on_mAtlasFeatureFilterButton_clicked()
QString expression = exprDlg.expressionText();
if ( !expression.isEmpty() )
{
// will emit a textChanged signal
mAtlasFeatureFilterEdit->setText( expression );
atlasMap->setFeatureFilter( mAtlasFeatureFilterEdit->text() );
updateAtlasFeatures();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgsatlascompositionwidget.h
Expand Up @@ -47,7 +47,7 @@ class QgsAtlasCompositionWidget:
void on_mAtlasSortFeatureCheckBox_stateChanged( int state );
void on_mAtlasSortFeatureKeyComboBox_currentIndexChanged( int index );
void on_mAtlasSortFeatureDirectionButton_clicked();
void on_mAtlasFeatureFilterEdit_textChanged( const QString& text );
void on_mAtlasFeatureFilterEdit_editingFinished();
void on_mAtlasFeatureFilterButton_clicked();
void on_mAtlasFeatureFilterCheckBox_stateChanged( int state );
void on_mAtlasMarginSpinBox_valueChanged( int value );
Expand Down

0 comments on commit 9c5bbb7

Please sign in to comment.