Skip to content
Permalink
Browse files
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
  • Loading branch information
timlinux committed Sep 16, 2010
1 parent e9f245d commit 6d350ff216976117e3d3bf5c6a0bbf85994f97d4
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/app/qgisapp.cpp
@@ -1847,7 +1847,8 @@ void QgisApp::createStatusBar()
mScaleEdit->setMaximumHeight( 20 );
mScaleEdit->setContentsMargins( 0, 0, 0, 0 );
mScaleEdit->setAlignment( Qt::AlignLeft );
QRegExp validator( "\\d+\\.?\\d*:\\d+\\.?\\d*" );
// QRegExp validator( "\\d+\\.?\\d*:\\d+\\.?\\d*" );
QRegExp validator( "\\d+\\.?\\d*:\\d+\\.?\\d*|\\d+\\.?\\d*" );
mScaleEditValidator = new QRegExpValidator( validator, mScaleEdit );
mScaleEdit->setValidator( mScaleEditValidator );
mScaleEdit->setWhatsThis( tr( "Displays the current map scale" ) );
@@ -4932,6 +4933,15 @@ void QgisApp::userScale()
mMapCanvas->zoomScale( rightSide / leftSide );
}
}
else
{
bool rightOk;
double rightSide = parts.at( 0 ).toDouble( &rightOk );
if ( rightOk )
{
mMapCanvas->zoomScale( rightSide );
}
}
}

void QgisApp::userCenter()

0 comments on commit 6d350ff

Please sign in to comment.