Skip to content

Commit 44c8680

Browse files
authored
Remove canvas rotation option + API, now always enabled
1 parent 185ad05 commit 44c8680

File tree

7 files changed

+52
-92
lines changed

7 files changed

+52
-92
lines changed

doc/api_break.dox

+6
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ objects are implicitly shared, returning a copy helps simplify and make code mor
9797
only affects third party c++ providers, and does not affect PyQGIS scripts.</li>
9898
</ul>
9999

100+
\subsection qgis_api_break_3_0_QgsMapCanvas QgsMapCanvas
101+
102+
<ul>
103+
<li>rotationEnabled() and enableRotation() have been removed, since map rotation is now always supported</li>
104+
</ul>
105+
100106
\subsection qgis_api_break_3_0_QgsMapLayer QgsMapLayer
101107

102108
<ul>

python/gui/qgsmapcanvas.sip

-8
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,6 @@ class QgsMapCanvas : QGraphicsView
446446
//! ask user about datum transformation
447447
void getDatumTransformInfo( const QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId );
448448

449-
//! return if canvas rotation is enabled
450-
//! @note added in 2.8
451-
static bool rotationEnabled();
452-
453-
//! change canvas rotation support
454-
//! @note added in 2.8
455-
static void enableRotation( bool enabled );
456-
457449
//! Sets the factor of magnification to apply to the map canvas. Indeed, we
458450
//! increase/decrease the DPI of the map settings according to this factor
459451
//! in order to render marker point, labels, ... bigger.

src/app/qgisapp.cpp

+31-34
Original file line numberDiff line numberDiff line change
@@ -2328,40 +2328,37 @@ void QgisApp::createStatusBar()
23282328
mMagnifierWidget->updateMagnification( QSettings().value( "/qgis/magnifier_factor_default", 1.0 ).toDouble() );
23292329
statusBar()->addPermanentWidget( mMagnifierWidget, 0 );
23302330

2331-
if ( QgsMapCanvas::rotationEnabled() )
2332-
{
2333-
// add a widget to show/set current rotation
2334-
mRotationLabel = new QLabel( QString(), statusBar() );
2335-
mRotationLabel->setObjectName( "mRotationLabel" );
2336-
mRotationLabel->setFont( myFont );
2337-
mRotationLabel->setMinimumWidth( 10 );
2338-
//mRotationLabel->setMaximumHeight( 20 );
2339-
mRotationLabel->setMargin( 3 );
2340-
mRotationLabel->setAlignment( Qt::AlignCenter );
2341-
mRotationLabel->setFrameStyle( QFrame::NoFrame );
2342-
mRotationLabel->setText( tr( "Rotation" ) );
2343-
mRotationLabel->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
2344-
statusBar()->addPermanentWidget( mRotationLabel, 0 );
2345-
2346-
mRotationEdit = new QgsDoubleSpinBox( statusBar() );
2347-
mRotationEdit->setObjectName( "mRotationEdit" );
2348-
mRotationEdit->setClearValue( 0.0 );
2349-
mRotationEdit->setKeyboardTracking( false );
2350-
mRotationEdit->setMaximumWidth( 120 );
2351-
mRotationEdit->setDecimals( 1 );
2352-
mRotationEdit->setRange( -180.0, 180.0 );
2353-
mRotationEdit->setWrapping( true );
2354-
mRotationEdit->setSingleStep( 5.0 );
2355-
mRotationEdit->setFont( myFont );
2356-
mRotationEdit->setWhatsThis( tr( "Shows the current map clockwise rotation "
2357-
"in degrees. It also allows editing to set "
2358-
"the rotation" ) );
2359-
mRotationEdit->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
2360-
statusBar()->addPermanentWidget( mRotationEdit, 0 );
2361-
connect( mRotationEdit, SIGNAL( valueChanged( double ) ), this, SLOT( userRotation() ) );
2362-
2363-
showRotation();
2364-
}
2331+
// add a widget to show/set current rotation
2332+
mRotationLabel = new QLabel( QString(), statusBar() );
2333+
mRotationLabel->setObjectName( "mRotationLabel" );
2334+
mRotationLabel->setFont( myFont );
2335+
mRotationLabel->setMinimumWidth( 10 );
2336+
//mRotationLabel->setMaximumHeight( 20 );
2337+
mRotationLabel->setMargin( 3 );
2338+
mRotationLabel->setAlignment( Qt::AlignCenter );
2339+
mRotationLabel->setFrameStyle( QFrame::NoFrame );
2340+
mRotationLabel->setText( tr( "Rotation" ) );
2341+
mRotationLabel->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
2342+
statusBar()->addPermanentWidget( mRotationLabel, 0 );
2343+
2344+
mRotationEdit = new QgsDoubleSpinBox( statusBar() );
2345+
mRotationEdit->setObjectName( "mRotationEdit" );
2346+
mRotationEdit->setClearValue( 0.0 );
2347+
mRotationEdit->setKeyboardTracking( false );
2348+
mRotationEdit->setMaximumWidth( 120 );
2349+
mRotationEdit->setDecimals( 1 );
2350+
mRotationEdit->setRange( -180.0, 180.0 );
2351+
mRotationEdit->setWrapping( true );
2352+
mRotationEdit->setSingleStep( 5.0 );
2353+
mRotationEdit->setFont( myFont );
2354+
mRotationEdit->setWhatsThis( tr( "Shows the current map clockwise rotation "
2355+
"in degrees. It also allows editing to set "
2356+
"the rotation" ) );
2357+
mRotationEdit->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
2358+
statusBar()->addPermanentWidget( mRotationEdit, 0 );
2359+
connect( mRotationEdit, SIGNAL( valueChanged( double ) ), this, SLOT( userRotation() ) );
2360+
2361+
showRotation();
23652362

23662363
// render suppression status bar widget
23672364
mRenderSuppressionCBox = new QCheckBox( tr( "Render" ), statusBar() );

src/app/qgsoptions.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl )
642642
QgsClipboard::AttributesWithWKT : QgsClipboard::AttributesOnly ) );
643643
leNullValue->setText( mSettings->value( "qgis/nullValue", "NULL" ).toString() );
644644
cbxIgnoreShapeEncoding->setChecked( mSettings->value( "/qgis/ignoreShapeEncoding", true ).toBool() );
645-
cbxCanvasRotation->setChecked( QgsMapCanvas::rotationEnabled() );
646645

647646
cmbLegendDoubleClickAction->setCurrentIndex( mSettings->value( "/qgis/legendDoubleClickAction", 0 ).toInt() );
648647

@@ -1206,7 +1205,6 @@ void QgsOptions::saveOptions()
12061205
mSettings->setValue( "/qgis/legendDoubleClickAction", cmbLegendDoubleClickAction->currentIndex() );
12071206
bool legendLayersCapitalise = mSettings->value( "/qgis/capitaliseLayerName", false ).toBool();
12081207
mSettings->setValue( "/qgis/capitaliseLayerName", capitaliseCheckBox->isChecked() );
1209-
QgsMapCanvas::enableRotation( cbxCanvasRotation->isChecked() );
12101208

12111209
// Default simplify drawing configuration
12121210
QgsVectorSimplifyMethod::SimplifyHints simplifyHints = QgsVectorSimplifyMethod::NoSimplification;

src/gui/qgsmapcanvas.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -1021,9 +1021,6 @@ double QgsMapCanvas::rotation() const
10211021

10221022
void QgsMapCanvas::setRotation( double degrees )
10231023
{
1024-
if ( !rotationEnabled() )
1025-
return;
1026-
10271024
double current = rotation();
10281025

10291026
if ( degrees == current )
@@ -2197,16 +2194,6 @@ bool QgsMapCanvas::event( QEvent * e )
21972194
}
21982195
#endif
21992196

2200-
bool QgsMapCanvas::rotationEnabled()
2201-
{
2202-
return QSettings().value( "/qgis/canvasRotation", true ).toBool();
2203-
}
2204-
2205-
void QgsMapCanvas::enableRotation( bool enable )
2206-
{
2207-
QSettings().setValue( "/qgis/canvasRotation", enable );
2208-
}
2209-
22102197
void QgsMapCanvas::refreshAllLayers()
22112198
{
22122199
// reload all layers in canvas

src/gui/qgsmapcanvas.h

-8
Original file line numberDiff line numberDiff line change
@@ -516,14 +516,6 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
516516
//! ask user about datum transformation
517517
void getDatumTransformInfo( const QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId );
518518

519-
//! return if canvas rotation is enabled
520-
//! @note added in 2.8
521-
static bool rotationEnabled();
522-
523-
//! change canvas rotation support
524-
//! @note added in 2.8
525-
static void enableRotation( bool enabled );
526-
527519
//! Sets the factor of magnification to apply to the map canvas. Indeed, we
528520
//! increase/decrease the DPI of the map settings according to this factor
529521
//! in order to render marker point, labels, ... bigger.

src/ui/qgsoptionsbase.ui

+15-27
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
<item>
309309
<widget class="QStackedWidget" name="mOptionsStackedWidget">
310310
<property name="currentIndex">
311-
<number>2</number>
311+
<number>0</number>
312312
</property>
313313
<widget class="QWidget" name="mOptionsPageGeneral">
314314
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -338,7 +338,7 @@
338338
<x>0</x>
339339
<y>0</y>
340340
<width>723</width>
341-
<height>670</height>
341+
<height>640</height>
342342
</rect>
343343
</property>
344344
<layout class="QVBoxLayout" name="verticalLayout_28">
@@ -681,17 +681,6 @@
681681
</item>
682682
</layout>
683683
</item>
684-
<item>
685-
<layout class="QHBoxLayout" name="horizontalLayout_32">
686-
<item>
687-
<widget class="QCheckBox" name="cbxCanvasRotation">
688-
<property name="text">
689-
<string>Canvas rotation support (restart required)</string>
690-
</property>
691-
</widget>
692-
</item>
693-
</layout>
694-
</item>
695684
</layout>
696685
</widget>
697686
</item>
@@ -2623,8 +2612,8 @@
26232612
<rect>
26242613
<x>0</x>
26252614
<y>0</y>
2626-
<width>147</width>
2627-
<height>240</height>
2615+
<width>617</width>
2616+
<height>607</height>
26282617
</rect>
26292618
</property>
26302619
<layout class="QHBoxLayout" name="horizontalLayout_46">
@@ -2770,8 +2759,8 @@
27702759
<rect>
27712760
<x>0</x>
27722761
<y>0</y>
2773-
<width>528</width>
2774-
<height>327</height>
2762+
<width>617</width>
2763+
<height>607</height>
27752764
</rect>
27762765
</property>
27772766
<layout class="QVBoxLayout" name="verticalLayout_25">
@@ -3544,8 +3533,8 @@
35443533
<rect>
35453534
<x>0</x>
35463535
<y>0</y>
3547-
<width>514</width>
3548-
<height>571</height>
3536+
<width>617</width>
3537+
<height>607</height>
35493538
</rect>
35503539
</property>
35513540
<layout class="QVBoxLayout" name="verticalLayout_39">
@@ -3813,7 +3802,7 @@
38133802
<rect>
38143803
<x>0</x>
38153804
<y>0</y>
3816-
<width>570</width>
3805+
<width>601</width>
38173806
<height>668</height>
38183807
</rect>
38193808
</property>
@@ -4358,8 +4347,8 @@
43584347
<rect>
43594348
<x>0</x>
43604349
<y>0</y>
4361-
<width>474</width>
4362-
<height>372</height>
4350+
<width>617</width>
4351+
<height>607</height>
43634352
</rect>
43644353
</property>
43654354
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -4497,7 +4486,7 @@
44974486
<rect>
44984487
<x>0</x>
44994488
<y>0</y>
4500-
<width>574</width>
4489+
<width>601</width>
45014490
<height>644</height>
45024491
</rect>
45034492
</property>
@@ -4743,8 +4732,8 @@
47434732
<rect>
47444733
<x>0</x>
47454734
<y>0</y>
4746-
<width>305</width>
4747-
<height>226</height>
4735+
<width>617</width>
4736+
<height>607</height>
47484737
</rect>
47494738
</property>
47504739
<layout class="QVBoxLayout" name="verticalLayout_32">
@@ -4852,7 +4841,7 @@
48524841
<rect>
48534842
<x>0</x>
48544843
<y>0</y>
4855-
<width>542</width>
4844+
<width>601</width>
48564845
<height>737</height>
48574846
</rect>
48584847
</property>
@@ -5430,7 +5419,6 @@
54305419
<tabstop>mCustomGroupBoxChkBx</tabstop>
54315420
<tabstop>mNativeColorDialogsChkBx</tabstop>
54325421
<tabstop>mLiveColorDialogsChkBx</tabstop>
5433-
<tabstop>cbxCanvasRotation</tabstop>
54345422
<tabstop>mProjectOnLaunchCmbBx</tabstop>
54355423
<tabstop>mProjectOnLaunchLineEdit</tabstop>
54365424
<tabstop>mProjectOnLaunchPushBtn</tabstop>

0 commit comments

Comments
 (0)