Skip to content
Permalink
Browse files

[processing] Fix manual entry of extent values in widget

Fixes #36787
  • Loading branch information
nyalldawson committed Jun 10, 2020
1 parent af19cea commit ccc34c76e714e5f6f87d2a329ca048896eb4c87f
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/gui/qgsextentwidget.cpp
@@ -36,11 +36,10 @@ QgsExtentWidget::QgsExtentWidget( QWidget *parent, WidgetStyle style )
connect( mYMinLineEdit, &QLineEdit::textEdited, this, &QgsExtentWidget::setOutputExtentFromLineEdit );
connect( mYMaxLineEdit, &QLineEdit::textEdited, this, &QgsExtentWidget::setOutputExtentFromLineEdit );

mCondensedRe = QRegularExpression( QStringLiteral( "\\s*([\\d\\.]+)\\s*,\\s*([\\d\\.]+)\\s*,\\s*([\\d\\.]+)\\s*,\\s*([\\d\\.]+)\\s*(\\[.*?\\])" ) );
mCondensedRe = QRegularExpression( QStringLiteral( "\\s*([\\d\\.\\-]+)\\s*,\\s*([\\d\\.\\-]+)\\s*,\\s*([\\d\\.\\-]+)\\s*,\\s*([\\d\\.\\-]+)\\s*(?:\\[(.*?)\\])?" ) );
mCondensedLineEdit->setValidator( new QRegularExpressionValidator( mCondensedRe, this ) );
mCondensedLineEdit->setShowClearButton( false );
connect( mCondensedLineEdit, &QgsFilterLineEdit::cleared, this, &QgsExtentWidget::clear );

connect( mCondensedLineEdit, &QLineEdit::textEdited, this, &QgsExtentWidget::setOutputExtentFromCondensedLineEdit );

mLayerMenu = new QMenu( tr( "Calculate from Layer" ) );
@@ -246,7 +245,14 @@ void QgsExtentWidget::setOutputExtentFromCondensedLineEdit()
whileBlocking( mXMaxLineEdit )->setText( match.captured( 2 ) );
whileBlocking( mYMinLineEdit )->setText( match.captured( 3 ) );
whileBlocking( mYMaxLineEdit )->setText( match.captured( 4 ) );
if ( !match.captured( 5 ).isEmpty() )
{
mOutputCrs = QgsCoordinateReferenceSystem( match.captured( 5 ) );
}

emit extentChanged( outputExtent() );
if ( !mIsValid )
setValid( true );
}
}
}

0 comments on commit ccc34c7

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