Skip to content
Permalink
Browse files
Modify testqgsscalecombobox to match modified behaviour of QgsScaleCo…
…mboBox
  • Loading branch information
mhugent committed Mar 7, 2013
1 parent cd2be4b commit e65f208f36c667931c88e4e012b327db2e6956c1
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/gui/qgsscalecombobox.cpp
  2. +3 −3 tests/src/gui/testqgsscalecombobox.cpp
@@ -157,7 +157,7 @@ void QgsScaleComboBox::fixupScale()
if ( ok && ( newScale != oldScale ) )
{
// if a user types scale = 2345, we transform to 1:2345
if ( userSetScale )
if ( userSetScale && newScale >= 1.0 )
{
mScale = 1 / newScale;
}
@@ -75,12 +75,12 @@ void TestQgsScaleComboBox::basic()
QCOMPARE( s->scaleString(), QString( "1:50" ) );
QCOMPARE( s->scale(), ( double ) 0.02 );

// Testing conversion from number to "x:1"
// Testing conversion from number to "1:x"
l->setText( "" );
QTest::keyClicks( l, QLocale::system().toString( 42 ) );
QTest::keyClick( l, Qt::Key_Return );
QCOMPARE( s->scaleString(), QString( "42:1" ) );
QCOMPARE( s->scale(), ( double ) 42 );
QCOMPARE( s->scaleString(), QString( "1:42" ) );
QCOMPARE( s->scale(), ( double ) 1.0 / ( double ) 42.0 );

// Testing rounding and conversion from illegal

0 comments on commit e65f208

Please sign in to comment.