Skip to content
Permalink
Browse files

Never use scientific notation

  • Loading branch information
troopa81 committed Apr 30, 2019
1 parent b7772d4 commit 9cfaf10c426dbe2882a4fedab4f5cda2cf3a1a75
Showing with 15 additions and 15 deletions.
  1. +2 −2 src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp
  2. +13 −13 tests/src/gui/testprocessinggui.cpp
@@ -2206,8 +2206,8 @@ void QgsProcessingPointPanel::clear()
void QgsProcessingPointPanel::setValue( const QgsPointXY &point, const QgsCoordinateReferenceSystem &crs )
{
QString newText = QStringLiteral( "%1,%2" )
.arg( QString::number( point.x(), 'g', 18 ) )
.arg( QString::number( point.y(), 'g', 18 ) );
.arg( QString::number( point.x(), 'f' ) )
.arg( QString::number( point.y(), 'f' ) );

mCrs = crs;
if ( mCrs.isValid() )
@@ -2834,15 +2834,15 @@ void TestProcessingGui::testPointPanel()
QSignalSpy spy( panel.get(), &QgsProcessingPointPanel::changed );

panel->setValue( QgsPointXY( 100, 150 ), QgsCoordinateReferenceSystem() );
QCOMPARE( panel->value().toString(), QStringLiteral( "100,150" ) );
QCOMPARE( panel->value().toString(), QStringLiteral( "100.000000,150.000000" ) );
QCOMPARE( spy.count(), 1 );

panel->setValue( QgsPointXY( 200, 250 ), QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3111" ) ) );
QCOMPARE( panel->value().toString(), QStringLiteral( "200,250 [EPSG:3111]" ) );
QCOMPARE( panel->value().toString(), QStringLiteral( "200.000000,250.000000 [EPSG:3111]" ) );
QCOMPARE( spy.count(), 2 );

panel->setValue( QgsPointXY( 123456.123456789122, 654321.987654321012 ), QgsCoordinateReferenceSystem() );
QCOMPARE( panel->value().toString(), QStringLiteral( "123456.123456789122,654321.987654321012" ) );
panel->setValue( QgsPointXY( 123456.123456789, 654321.987654321 ), QgsCoordinateReferenceSystem() );
QCOMPARE( panel->value().toString(), QStringLiteral( "123456.123457,654321.987654" ) );
QCOMPARE( spy.count(), 3 );

QVERIFY( !panel->mLineEdit->showClearButton() );
@@ -2856,7 +2856,7 @@ void TestProcessingGui::testPointPanel()
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( panel->value().toString(), QStringLiteral( "1.500000,-3.500000 [EPSG:28356]" ) );
QCOMPARE( spy.count(), 5 );

panel.reset();
@@ -2879,8 +2879,8 @@ void TestProcessingGui::testPointWrapper()
QCOMPARE( spy.count(), 1 );
if ( type != QgsProcessingGui::Modeler )
{
QCOMPARE( wrapper.widgetValue().toString(), QStringLiteral( "1,2" ) );
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1,2" ) );
QCOMPARE( wrapper.widgetValue().toString(), QStringLiteral( "1.000000,2.000000" ) );
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1.000000,2.000000" ) );
}
else
{
@@ -2891,8 +2891,8 @@ void TestProcessingGui::testPointWrapper()
QCOMPARE( spy.count(), 2 );
if ( type != QgsProcessingGui::Modeler )
{
QCOMPARE( wrapper.widgetValue().toString(), QStringLiteral( "1,2 [EPSG:3111]" ) );
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1,2 [EPSG:3111]" ) );
QCOMPARE( wrapper.widgetValue().toString(), QStringLiteral( "1.000000,2.000000 [EPSG:3111]" ) );
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1.000000,2.000000 [EPSG:3111]" ) );
}
else
{
@@ -2939,8 +2939,8 @@ void TestProcessingGui::testPointWrapper()
QCOMPARE( spy2.count(), 1 );
if ( type != QgsProcessingGui::Modeler )
{
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper2.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1,2" ) );
QCOMPARE( wrapper2.widgetValue().toString(), QStringLiteral( "1,2" ) );
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper2.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1.000000,2.000000" ) );
QCOMPARE( wrapper2.widgetValue().toString(), QStringLiteral( "1.000000,2.000000" ) );
}
else
{
@@ -2952,8 +2952,8 @@ void TestProcessingGui::testPointWrapper()
QCOMPARE( spy2.count(), 2 );
if ( type != QgsProcessingGui::Modeler )
{
QCOMPARE( wrapper2.widgetValue().toString(), QStringLiteral( "1,2 [EPSG:3111]" ) );
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper2.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1,2 [EPSG:3111]" ) );
QCOMPARE( wrapper2.widgetValue().toString(), QStringLiteral( "1.000000,2.000000 [EPSG:3111]" ) );
QCOMPARE( static_cast< QgsProcessingPointPanel * >( wrapper2.wrappedWidget() )->mLineEdit->text(), QStringLiteral( "1.000000,2.000000 [EPSG:3111]" ) );
}
else
{

0 comments on commit 9cfaf10

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