diff --git a/src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp b/src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp index 9abc94e2113e..04002677a5c1 100644 --- a/src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp +++ b/src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp @@ -2205,7 +2205,10 @@ void QgsProcessingPointPanel::clear() void QgsProcessingPointPanel::setValue( const QgsPointXY &point, const QgsCoordinateReferenceSystem &crs ) { - QString newText = QStringLiteral( "%1,%2" ).arg( point.x() ).arg( point.y() ); + QString newText = QStringLiteral( "%1,%2" ) + .arg( QString::number( point.x(), 'g', 18 ) ) + .arg( QString::number( point.y(), 'g', 18 ) ); + mCrs = crs; if ( mCrs.isValid() ) { diff --git a/tests/src/gui/testprocessinggui.cpp b/tests/src/gui/testprocessinggui.cpp index b40cee547ac7..15e7eb33090c 100644 --- a/tests/src/gui/testprocessinggui.cpp +++ b/tests/src/gui/testprocessinggui.cpp @@ -2841,19 +2841,23 @@ void TestProcessingGui::testPointPanel() QCOMPARE( panel->value().toString(), QStringLiteral( "200,250 [EPSG:3111]" ) ); QCOMPARE( spy.count(), 2 ); + panel->setValue( QgsPointXY( 123456.123456789122, 654321.987654321012 ), QgsCoordinateReferenceSystem() ); + QCOMPARE( panel->value().toString(), QStringLiteral( "123456.123456789122,654321.987654321012" ) ); + QCOMPARE( spy.count(), 3 ); + QVERIFY( !panel->mLineEdit->showClearButton() ); panel->setAllowNull( true ); QVERIFY( panel->mLineEdit->showClearButton() ); panel->clear(); QVERIFY( !panel->value().isValid() ); - QCOMPARE( spy.count(), 3 ); + QCOMPARE( spy.count(), 4 ); QgsMapCanvas canvas; canvas.setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:28356" ) ) ); panel->setMapCanvas( &canvas ); panel->updatePoint( QgsPointXY( 1.5, -3.5 ) ); QCOMPARE( panel->value().toString(), QStringLiteral( "1.5,-3.5 [EPSG:28356]" ) ); - QCOMPARE( spy.count(), 4 ); + QCOMPARE( spy.count(), 5 ); panel.reset(); }