Skip to content

Commit 6d350ff

Browse files
author
timlinux
committed
Applied patch from #3005 - allow entry of scale without leading 1:
git-svn-id: http://svn.osgeo.org/qgis/trunk@14242 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e9f245d commit 6d350ff

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/app/qgisapp.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,8 @@ void QgisApp::createStatusBar()
18471847
mScaleEdit->setMaximumHeight( 20 );
18481848
mScaleEdit->setContentsMargins( 0, 0, 0, 0 );
18491849
mScaleEdit->setAlignment( Qt::AlignLeft );
1850-
QRegExp validator( "\\d+\\.?\\d*:\\d+\\.?\\d*" );
1850+
// QRegExp validator( "\\d+\\.?\\d*:\\d+\\.?\\d*" );
1851+
QRegExp validator( "\\d+\\.?\\d*:\\d+\\.?\\d*|\\d+\\.?\\d*" );
18511852
mScaleEditValidator = new QRegExpValidator( validator, mScaleEdit );
18521853
mScaleEdit->setValidator( mScaleEditValidator );
18531854
mScaleEdit->setWhatsThis( tr( "Displays the current map scale" ) );
@@ -4932,6 +4933,15 @@ void QgisApp::userScale()
49324933
mMapCanvas->zoomScale( rightSide / leftSide );
49334934
}
49344935
}
4936+
else
4937+
{
4938+
bool rightOk;
4939+
double rightSide = parts.at( 0 ).toDouble( &rightOk );
4940+
if ( rightOk )
4941+
{
4942+
mMapCanvas->zoomScale( rightSide );
4943+
}
4944+
}
49354945
}
49364946

49374947
void QgisApp::userCenter()

0 commit comments

Comments
 (0)