Skip to content

Commit 916a27f

Browse files
committed
make canvas rotation support available in options
1 parent bff64fd commit 916a27f

File tree

3 files changed

+47
-38
lines changed

3 files changed

+47
-38
lines changed

src/app/qgisapp.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,8 @@ void QgisApp::createStatusBar()
17501750
statusBar()->addPermanentWidget( mScaleEdit, 0 );
17511751
connect( mScaleEdit, SIGNAL( scaleChanged() ), this, SLOT( userScale() ) );
17521752

1753-
if ( getenv( "QGIS_ENABLE_CANVAS_ROTATION" ) ) {
1753+
if ( QSettings().value( "/qgis/canvasRotation", false ).toBool() )
1754+
{
17541755
// add a widget to show/set current rotation
17551756
mRotationLabel = new QLabel( QString(), statusBar() );
17561757
mRotationLabel->setObjectName( "mRotationLabel" );
@@ -1785,7 +1786,6 @@ void QgisApp::createStatusBar()
17851786
showRotation();
17861787
}
17871788

1788-
17891789
// render suppression status bar widget
17901790
mRenderSuppressionCBox = new QCheckBox( tr( "Render" ), statusBar() );
17911791
mRenderSuppressionCBox->setObjectName( "mRenderSuppressionCBox" );
@@ -3559,7 +3559,7 @@ void QgisApp::fileNew( bool thePromptToSaveFlag, bool forceBlank )
35593559
mMapCanvas->freeze( false );
35603560
mMapCanvas->refresh();
35613561
mMapCanvas->clearExtentHistory();
3562-
mMapCanvas->setRotation(0.0);
3562+
mMapCanvas->setRotation( 0.0 );
35633563
mScaleEdit->updateScales();
35643564

35653565
// set project CRS

src/app/qgsoptions.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
585585
cbxCopyWKTGeomFromTable->setChecked( settings.value( "/qgis/copyGeometryAsWKT", true ).toBool() );
586586
leNullValue->setText( settings.value( "qgis/nullValue", "NULL" ).toString() );
587587
cbxIgnoreShapeEncoding->setChecked( settings.value( "/qgis/ignoreShapeEncoding", true ).toBool() );
588+
cbxCanvasRotation->setChecked( settings.value( "/qgis/canvasRotation", false ).toBool() );
588589

589590
cmbLegendDoubleClickAction->setCurrentIndex( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() );
590591

@@ -1112,6 +1113,7 @@ void QgsOptions::saveOptions()
11121113
settings.setValue( "/qgis/legendDoubleClickAction", cmbLegendDoubleClickAction->currentIndex() );
11131114
bool legendLayersCapitalise = settings.value( "/qgis/capitaliseLayerName", false ).toBool();
11141115
settings.setValue( "/qgis/capitaliseLayerName", capitaliseCheckBox->isChecked() );
1116+
settings.setValue( "/qgis/canvasRotation", cbxCanvasRotation->isChecked() );
11151117

11161118
// Default simplify drawing configuration
11171119
QgsVectorSimplifyMethod::SimplifyHints simplifyHints = QgsVectorSimplifyMethod::NoSimplification;

src/ui/qgsoptionsbase.ui

+42-35
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@
283283
<rect>
284284
<x>0</x>
285285
<y>0</y>
286-
<width>610</width>
287-
<height>670</height>
286+
<width>612</width>
287+
<height>594</height>
288288
</rect>
289289
</property>
290290
<layout class="QVBoxLayout" name="verticalLayout_28">
@@ -648,6 +648,13 @@
648648
</property>
649649
</widget>
650650
</item>
651+
<item>
652+
<widget class="QCheckBox" name="cbxCanvasRotation">
653+
<property name="text">
654+
<string>Experimental canvas rotation support (restart required)</string>
655+
</property>
656+
</widget>
657+
</item>
651658
</layout>
652659
</item>
653660
</layout>
@@ -954,8 +961,8 @@
954961
<rect>
955962
<x>0</x>
956963
<y>0</y>
957-
<width>655</width>
958-
<height>862</height>
964+
<width>614</width>
965+
<height>855</height>
959966
</rect>
960967
</property>
961968
<layout class="QVBoxLayout" name="verticalLayout_22">
@@ -1150,10 +1157,10 @@
11501157
<property name="title">
11511158
<string>Current environment variables (read-only - bold indicates modified at startup)</string>
11521159
</property>
1153-
<property name="collapsed" stdset="0">
1160+
<property name="collapsed">
11541161
<bool>false</bool>
11551162
</property>
1156-
<property name="saveCollapsedState" stdset="0">
1163+
<property name="saveCollapsedState">
11571164
<bool>true</bool>
11581165
</property>
11591166
<layout class="QVBoxLayout" name="verticalLayout_8">
@@ -1329,8 +1336,8 @@
13291336
<rect>
13301337
<x>0</x>
13311338
<y>0</y>
1332-
<width>531</width>
1333-
<height>440</height>
1339+
<width>504</width>
1340+
<height>383</height>
13341341
</rect>
13351342
</property>
13361343
<layout class="QVBoxLayout" name="verticalLayout_27">
@@ -1639,8 +1646,8 @@
16391646
<rect>
16401647
<x>0</x>
16411648
<y>0</y>
1642-
<width>710</width>
1643-
<height>796</height>
1649+
<width>665</width>
1650+
<height>699</height>
16441651
</rect>
16451652
</property>
16461653
<layout class="QVBoxLayout" name="verticalLayout_29">
@@ -2278,8 +2285,8 @@
22782285
<rect>
22792286
<x>0</x>
22802287
<y>0</y>
2281-
<width>239</width>
2282-
<height>258</height>
2288+
<width>203</width>
2289+
<height>252</height>
22832290
</rect>
22842291
</property>
22852292
<layout class="QHBoxLayout" name="horizontalLayout_46">
@@ -2374,8 +2381,8 @@
23742381
<rect>
23752382
<x>0</x>
23762383
<y>0</y>
2377-
<width>526</width>
2378-
<height>327</height>
2384+
<width>509</width>
2385+
<height>302</height>
23792386
</rect>
23802387
</property>
23812388
<layout class="QVBoxLayout" name="verticalLayout_25">
@@ -2703,8 +2710,8 @@
27032710
<rect>
27042711
<x>0</x>
27052712
<y>0</y>
2706-
<width>684</width>
2707-
<height>625</height>
2713+
<width>638</width>
2714+
<height>576</height>
27082715
</rect>
27092716
</property>
27102717
<layout class="QVBoxLayout" name="verticalLayout_30">
@@ -3199,8 +3206,8 @@
31993206
<rect>
32003207
<x>0</x>
32013208
<y>0</y>
3202-
<width>504</width>
3203-
<height>307</height>
3209+
<width>469</width>
3210+
<height>288</height>
32043211
</rect>
32053212
</property>
32063213
<layout class="QVBoxLayout" name="verticalLayout_39">
@@ -3395,8 +3402,8 @@
33953402
<rect>
33963403
<x>0</x>
33973404
<y>0</y>
3398-
<width>501</width>
3399-
<height>640</height>
3405+
<width>473</width>
3406+
<height>566</height>
34003407
</rect>
34013408
</property>
34023409
<layout class="QVBoxLayout" name="verticalLayout_31">
@@ -3886,8 +3893,8 @@
38863893
<rect>
38873894
<x>0</x>
38883895
<y>0</y>
3889-
<width>462</width>
3890-
<height>372</height>
3896+
<width>422</width>
3897+
<height>362</height>
38913898
</rect>
38923899
</property>
38933900
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -4016,8 +4023,8 @@
40164023
<rect>
40174024
<x>0</x>
40184025
<y>0</y>
4019-
<width>650</width>
4020-
<height>707</height>
4026+
<width>595</width>
4027+
<height>680</height>
40214028
</rect>
40224029
</property>
40234030
<layout class="QGridLayout" name="gridLayout_15">
@@ -4270,8 +4277,8 @@
42704277
<rect>
42714278
<x>0</x>
42724279
<y>0</y>
4273-
<width>300</width>
4274-
<height>226</height>
4280+
<width>283</width>
4281+
<height>210</height>
42754282
</rect>
42764283
</property>
42774284
<layout class="QVBoxLayout" name="verticalLayout_32">
@@ -4360,8 +4367,8 @@
43604367
<rect>
43614368
<x>0</x>
43624369
<y>0</y>
4363-
<width>531</width>
4364-
<height>685</height>
4370+
<width>487</width>
4371+
<height>595</height>
43654372
</rect>
43664373
</property>
43674374
<layout class="QVBoxLayout" name="verticalLayout_33">
@@ -4510,10 +4517,10 @@
45104517
<property name="checkable">
45114518
<bool>true</bool>
45124519
</property>
4513-
<property name="collapsed" stdset="0">
4520+
<property name="collapsed">
45144521
<bool>false</bool>
45154522
</property>
4516-
<property name="saveCollapsedState" stdset="0">
4523+
<property name="saveCollapsedState">
45174524
<bool>true</bool>
45184525
</property>
45194526
<layout class="QGridLayout" name="gridLayout_1">
@@ -4711,17 +4718,17 @@
47114718
</widget>
47124719
<layoutdefault spacing="6" margin="11"/>
47134720
<customwidgets>
4714-
<customwidget>
4715-
<class>QgsColorButtonV2</class>
4716-
<extends>QToolButton</extends>
4717-
<header>qgscolorbuttonv2.h</header>
4718-
</customwidget>
47194721
<customwidget>
47204722
<class>QgsCollapsibleGroupBox</class>
47214723
<extends>QGroupBox</extends>
47224724
<header>qgscollapsiblegroupbox.h</header>
47234725
<container>1</container>
47244726
</customwidget>
4727+
<customwidget>
4728+
<class>QgsColorButtonV2</class>
4729+
<extends>QToolButton</extends>
4730+
<header>qgscolorbuttonv2.h</header>
4731+
</customwidget>
47254732
<customwidget>
47264733
<class>QgsColorSchemeList</class>
47274734
<extends>QTreeView</extends>

0 commit comments

Comments
 (0)