Skip to content

Commit

Permalink
Flip rotation spin box to QgsDoubleSpinBox
Browse files Browse the repository at this point in the history
Fix some other small spin box related ux improvements (fix #11833)
  • Loading branch information
nyalldawson committed Dec 10, 2014
1 parent 714a1e6 commit 21c4cbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -1759,11 +1759,14 @@ void QgisApp::createStatusBar()
mRotationLabel->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
statusBar()->addPermanentWidget( mRotationLabel, 0 );

mRotationEdit = new QSpinBox( statusBar() );
mRotationEdit = new QgsDoubleSpinBox( statusBar() );
mRotationEdit->setObjectName( "mRotationEdit" );
mRotationEdit->setMaximumWidth( 100 );
mRotationEdit->setClearValue( 0.0 );
mRotationEdit->setKeyboardTracking( false );
mRotationEdit->setMaximumWidth( 120 );
mRotationEdit->setDecimals( 1 );
mRotationEdit->setMaximumHeight( 20 );
mRotationEdit->setRange( -180, 180 );
mRotationEdit->setRange( -180.0, 180.0 );
mRotationEdit->setWrapping( true );
mRotationEdit->setSingleStep( 5.0 );
mRotationEdit->setFont( myFont );
Expand All @@ -1772,7 +1775,7 @@ void QgisApp::createStatusBar()
"the rotation" ) );
mRotationEdit->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
statusBar()->addPermanentWidget( mRotationEdit, 0 );
connect( mRotationEdit, SIGNAL( valueChanged( int ) ), this, SLOT( userRotation() ) );
connect( mRotationEdit, SIGNAL( valueChanged( double ) ), this, SLOT( userRotation() ) );

showRotation();

Expand Down
3 changes: 2 additions & 1 deletion src/app/qgisapp.h
Expand Up @@ -62,6 +62,7 @@ class QgsRectangle;
class QgsUndoWidget;
class QgsVectorLayer;
class QgsVectorLayerTools;
class QgsDoubleSpinBox;

class QDomDocument;
class QNetworkReply;
Expand Down Expand Up @@ -1446,7 +1447,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
//! Widget that will live on the statusbar to display "Rotation"
QLabel * mRotationLabel;
//! Widget that will live in the statusbar to display and edit rotation
QSpinBox * mRotationEdit;
QgsDoubleSpinBox * mRotationEdit;
//! The validator for the mCoordsEdit
QValidator * mRotationEditValidator;
//! Widget that will live in the statusbar to show progress of operations
Expand Down

0 comments on commit 21c4cbb

Please sign in to comment.