Skip to content
Permalink
Browse files

Remove canvas rotation option + API, now always enabled

  • Loading branch information
nyalldawson committed Jul 20, 2016
1 parent 185ad05 commit 44c8680b00b8ba298baa9604af8880370c6a3e99
Showing with 52 additions and 92 deletions.
  1. +6 −0 doc/api_break.dox
  2. +0 −8 python/gui/qgsmapcanvas.sip
  3. +31 −34 src/app/qgisapp.cpp
  4. +0 −2 src/app/qgsoptions.cpp
  5. +0 −13 src/gui/qgsmapcanvas.cpp
  6. +0 −8 src/gui/qgsmapcanvas.h
  7. +15 −27 src/ui/qgsoptionsbase.ui
@@ -97,6 +97,12 @@ objects are implicitly shared, returning a copy helps simplify and make code mor
only affects third party c++ providers, and does not affect PyQGIS scripts.</li>
</ul>

\subsection qgis_api_break_3_0_QgsMapCanvas QgsMapCanvas

<ul>
<li>rotationEnabled() and enableRotation() have been removed, since map rotation is now always supported</li>
</ul>

\subsection qgis_api_break_3_0_QgsMapLayer QgsMapLayer

<ul>
@@ -446,14 +446,6 @@ class QgsMapCanvas : QGraphicsView
//! ask user about datum transformation
void getDatumTransformInfo( const QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId );

//! return if canvas rotation is enabled
//! @note added in 2.8
static bool rotationEnabled();

//! change canvas rotation support
//! @note added in 2.8
static void enableRotation( bool enabled );

//! Sets the factor of magnification to apply to the map canvas. Indeed, we
//! increase/decrease the DPI of the map settings according to this factor
//! in order to render marker point, labels, ... bigger.
@@ -2328,40 +2328,37 @@ void QgisApp::createStatusBar()
mMagnifierWidget->updateMagnification( QSettings().value( "/qgis/magnifier_factor_default", 1.0 ).toDouble() );
statusBar()->addPermanentWidget( mMagnifierWidget, 0 );

if ( QgsMapCanvas::rotationEnabled() )
{
// add a widget to show/set current rotation
mRotationLabel = new QLabel( QString(), statusBar() );
mRotationLabel->setObjectName( "mRotationLabel" );
mRotationLabel->setFont( myFont );
mRotationLabel->setMinimumWidth( 10 );
//mRotationLabel->setMaximumHeight( 20 );
mRotationLabel->setMargin( 3 );
mRotationLabel->setAlignment( Qt::AlignCenter );
mRotationLabel->setFrameStyle( QFrame::NoFrame );
mRotationLabel->setText( tr( "Rotation" ) );
mRotationLabel->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
statusBar()->addPermanentWidget( mRotationLabel, 0 );

mRotationEdit = new QgsDoubleSpinBox( statusBar() );
mRotationEdit->setObjectName( "mRotationEdit" );
mRotationEdit->setClearValue( 0.0 );
mRotationEdit->setKeyboardTracking( false );
mRotationEdit->setMaximumWidth( 120 );
mRotationEdit->setDecimals( 1 );
mRotationEdit->setRange( -180.0, 180.0 );
mRotationEdit->setWrapping( true );
mRotationEdit->setSingleStep( 5.0 );
mRotationEdit->setFont( myFont );
mRotationEdit->setWhatsThis( tr( "Shows the current map clockwise rotation "
"in degrees. It also allows editing to set "
"the rotation" ) );
mRotationEdit->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
statusBar()->addPermanentWidget( mRotationEdit, 0 );
connect( mRotationEdit, SIGNAL( valueChanged( double ) ), this, SLOT( userRotation() ) );

showRotation();
}
// add a widget to show/set current rotation
mRotationLabel = new QLabel( QString(), statusBar() );
mRotationLabel->setObjectName( "mRotationLabel" );
mRotationLabel->setFont( myFont );
mRotationLabel->setMinimumWidth( 10 );
//mRotationLabel->setMaximumHeight( 20 );
mRotationLabel->setMargin( 3 );
mRotationLabel->setAlignment( Qt::AlignCenter );
mRotationLabel->setFrameStyle( QFrame::NoFrame );
mRotationLabel->setText( tr( "Rotation" ) );
mRotationLabel->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
statusBar()->addPermanentWidget( mRotationLabel, 0 );

mRotationEdit = new QgsDoubleSpinBox( statusBar() );
mRotationEdit->setObjectName( "mRotationEdit" );
mRotationEdit->setClearValue( 0.0 );
mRotationEdit->setKeyboardTracking( false );
mRotationEdit->setMaximumWidth( 120 );
mRotationEdit->setDecimals( 1 );
mRotationEdit->setRange( -180.0, 180.0 );
mRotationEdit->setWrapping( true );
mRotationEdit->setSingleStep( 5.0 );
mRotationEdit->setFont( myFont );
mRotationEdit->setWhatsThis( tr( "Shows the current map clockwise rotation "
"in degrees. It also allows editing to set "
"the rotation" ) );
mRotationEdit->setToolTip( tr( "Current clockwise map rotation in degrees" ) );
statusBar()->addPermanentWidget( mRotationEdit, 0 );
connect( mRotationEdit, SIGNAL( valueChanged( double ) ), this, SLOT( userRotation() ) );

showRotation();

// render suppression status bar widget
mRenderSuppressionCBox = new QCheckBox( tr( "Render" ), statusBar() );
@@ -642,7 +642,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl )
QgsClipboard::AttributesWithWKT : QgsClipboard::AttributesOnly ) );
leNullValue->setText( mSettings->value( "qgis/nullValue", "NULL" ).toString() );
cbxIgnoreShapeEncoding->setChecked( mSettings->value( "/qgis/ignoreShapeEncoding", true ).toBool() );
cbxCanvasRotation->setChecked( QgsMapCanvas::rotationEnabled() );

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

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

// Default simplify drawing configuration
QgsVectorSimplifyMethod::SimplifyHints simplifyHints = QgsVectorSimplifyMethod::NoSimplification;
@@ -1021,9 +1021,6 @@ double QgsMapCanvas::rotation() const

void QgsMapCanvas::setRotation( double degrees )
{
if ( !rotationEnabled() )
return;

double current = rotation();

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

bool QgsMapCanvas::rotationEnabled()
{
return QSettings().value( "/qgis/canvasRotation", true ).toBool();
}

void QgsMapCanvas::enableRotation( bool enable )
{
QSettings().setValue( "/qgis/canvasRotation", enable );
}

void QgsMapCanvas::refreshAllLayers()
{
// reload all layers in canvas
@@ -516,14 +516,6 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! ask user about datum transformation
void getDatumTransformInfo( const QgsMapLayer* ml, const QString& srcAuthId, const QString& destAuthId );

//! return if canvas rotation is enabled
//! @note added in 2.8
static bool rotationEnabled();

//! change canvas rotation support
//! @note added in 2.8
static void enableRotation( bool enabled );

//! Sets the factor of magnification to apply to the map canvas. Indeed, we
//! increase/decrease the DPI of the map settings according to this factor
//! in order to render marker point, labels, ... bigger.
@@ -308,7 +308,7 @@
<item>
<widget class="QStackedWidget" name="mOptionsStackedWidget">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="mOptionsPageGeneral">
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -338,7 +338,7 @@
<x>0</x>
<y>0</y>
<width>723</width>
<height>670</height>
<height>640</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_28">
@@ -681,17 +681,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_32">
<item>
<widget class="QCheckBox" name="cbxCanvasRotation">
<property name="text">
<string>Canvas rotation support (restart required)</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@@ -2623,8 +2612,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>147</width>
<height>240</height>
<width>617</width>
<height>607</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_46">
@@ -2770,8 +2759,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>528</width>
<height>327</height>
<width>617</width>
<height>607</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_25">
@@ -3544,8 +3533,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>514</width>
<height>571</height>
<width>617</width>
<height>607</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_39">
@@ -3813,7 +3802,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>570</width>
<width>601</width>
<height>668</height>
</rect>
</property>
@@ -4358,8 +4347,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>474</width>
<height>372</height>
<width>617</width>
<height>607</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -4497,7 +4486,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>574</width>
<width>601</width>
<height>644</height>
</rect>
</property>
@@ -4743,8 +4732,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>305</width>
<height>226</height>
<width>617</width>
<height>607</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_32">
@@ -4852,7 +4841,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>542</width>
<width>601</width>
<height>737</height>
</rect>
</property>
@@ -5430,7 +5419,6 @@
<tabstop>mCustomGroupBoxChkBx</tabstop>
<tabstop>mNativeColorDialogsChkBx</tabstop>
<tabstop>mLiveColorDialogsChkBx</tabstop>
<tabstop>cbxCanvasRotation</tabstop>
<tabstop>mProjectOnLaunchCmbBx</tabstop>
<tabstop>mProjectOnLaunchLineEdit</tabstop>
<tabstop>mProjectOnLaunchPushBtn</tabstop>

0 comments on commit 44c8680

Please sign in to comment.
You can’t perform that action at this time.