Skip to content

Commit 21c4cbb

Browse files
committed
Flip rotation spin box to QgsDoubleSpinBox
Fix some other small spin box related ux improvements (fix #11833)
1 parent 714a1e6 commit 21c4cbb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/app/qgisapp.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,11 +1759,14 @@ void QgisApp::createStatusBar()
17591759
mRotationLabel->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
17601760
statusBar()->addPermanentWidget( mRotationLabel, 0 );
17611761

1762-
mRotationEdit = new QSpinBox( statusBar() );
1762+
mRotationEdit = new QgsDoubleSpinBox( statusBar() );
17631763
mRotationEdit->setObjectName( "mRotationEdit" );
1764-
mRotationEdit->setMaximumWidth( 100 );
1764+
mRotationEdit->setClearValue( 0.0 );
1765+
mRotationEdit->setKeyboardTracking( false );
1766+
mRotationEdit->setMaximumWidth( 120 );
1767+
mRotationEdit->setDecimals( 1 );
17651768
mRotationEdit->setMaximumHeight( 20 );
1766-
mRotationEdit->setRange( -180, 180 );
1769+
mRotationEdit->setRange( -180.0, 180.0 );
17671770
mRotationEdit->setWrapping( true );
17681771
mRotationEdit->setSingleStep( 5.0 );
17691772
mRotationEdit->setFont( myFont );
@@ -1772,7 +1775,7 @@ void QgisApp::createStatusBar()
17721775
"the rotation" ) );
17731776
mRotationEdit->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
17741777
statusBar()->addPermanentWidget( mRotationEdit, 0 );
1775-
connect( mRotationEdit, SIGNAL( valueChanged( int ) ), this, SLOT( userRotation() ) );
1778+
connect( mRotationEdit, SIGNAL( valueChanged( double ) ), this, SLOT( userRotation() ) );
17761779

17771780
showRotation();
17781781

src/app/qgisapp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class QgsRectangle;
6262
class QgsUndoWidget;
6363
class QgsVectorLayer;
6464
class QgsVectorLayerTools;
65+
class QgsDoubleSpinBox;
6566

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

0 commit comments

Comments
 (0)