diff --git a/python/core/composer/qgscomposermap.sip b/python/core/composer/qgscomposermap.sip
index ce68afa6796..6075ab7af83 100644
--- a/python/core/composer/qgscomposermap.sip
+++ b/python/core/composer/qgscomposermap.sip
@@ -373,20 +373,21 @@ In case of annotations, the bounding rectangle can be larger than the map item r
reimplement setFrameStrokeWidth, so that updateBoundingRect() is called after setting the frame width */
%End
- void setMapRotation( double r );
+ void setMapRotation( double rotation );
%Docstring
- Sets rotation for the map - this does not affect the composer item shape, only the
- way the map is drawn within the item
+ Sets the ``rotation`` for the map - this does not affect the composer item shape, only the
+ way the map is drawn within the item. Rotation is in degrees, clockwise.
.. versionadded:: 2.1
+.. seealso:: mapRotation()
%End
double mapRotation( QgsComposerObject::PropertyValueType valueType = QgsComposerObject::EvaluatedValue ) const;
%Docstring
- Returns the rotation used for drawing the map within the composer item
- :return: rotation for map
+ Returns the rotation used for drawing the map within the composer item, in degrees clockwise.
\param valueType controls whether the returned value is the user specified rotation,
or the current evaluated rotation (which may be affected by data driven rotation
settings).
+.. seealso:: setMapRotation()
:rtype: float
%End
diff --git a/src/app/composer/qgscomposermapwidget.cpp b/src/app/composer/qgscomposermapwidget.cpp
index 448481a48e6..faaa3b5cec1 100644
--- a/src/app/composer/qgscomposermapwidget.cpp
+++ b/src/app/composer/qgscomposermapwidget.cpp
@@ -47,6 +47,7 @@ QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap *composerMap )
{
setupUi( this );
setPanelTitle( tr( "Map properties" ) );
+ mMapRotationSpinBox->setClearValue( 0 );
//add widget for general composer item properties
QgsComposerItemWidget *itemPropertiesWidget = new QgsComposerItemWidget( this, composerMap );
@@ -116,7 +117,7 @@ QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap *composerMap )
loadGridEntries();
loadOverviewEntries();
- connect( mMapRotationSpinBox, &QgsDoubleSpinBox::editingFinished, this, &QgsComposerMapWidget::rotationChanged );
+ connect( mMapRotationSpinBox, static_cast < void ( QgsDoubleSpinBox::* )( double ) > ( &QgsDoubleSpinBox::valueChanged ), this, &QgsComposerMapWidget::rotationChanged );
blockAllSignals( false );
}
@@ -451,7 +452,7 @@ void QgsComposerMapWidget::on_mScaleLineEdit_editingFinished()
mComposerMap->endCommand();
}
-void QgsComposerMapWidget::rotationChanged()
+void QgsComposerMapWidget::rotationChanged( double value )
{
if ( !mComposerMap )
{
@@ -459,7 +460,7 @@ void QgsComposerMapWidget::rotationChanged()
}
mComposerMap->beginCommand( tr( "Map rotation changed" ), QgsComposerMergeCommand::ComposerMapRotation );
- mComposerMap->setMapRotation( mMapRotationSpinBox->value() );
+ mComposerMap->setMapRotation( value );
mComposerMap->endCommand();
mComposerMap->invalidateCache();
}
diff --git a/src/app/composer/qgscomposermapwidget.h b/src/app/composer/qgscomposermapwidget.h
index c44932692ec..176f6d492c0 100644
--- a/src/app/composer/qgscomposermapwidget.h
+++ b/src/app/composer/qgscomposermapwidget.h
@@ -130,7 +130,7 @@ class QgsComposerMapWidget: public QgsComposerItemBaseWidget, private Ui::QgsCom
//! Blocks / unblocks the signals of all GUI elements
void blockAllSignals( bool b );
- void rotationChanged();
+ void rotationChanged( double value );
void handleChangedFrameDisplay( QgsComposerMapGrid::BorderSide border, const QgsComposerMapGrid::DisplayMode mode );
void handleChangedAnnotationDisplay( QgsComposerMapGrid::BorderSide border, const QString &text );
diff --git a/src/core/composer/qgscomposermap.cpp b/src/core/composer/qgscomposermap.cpp
index 9b3266bd689..0fe16794bee 100644
--- a/src/core/composer/qgscomposermap.cpp
+++ b/src/core/composer/qgscomposermap.cpp
@@ -901,12 +901,12 @@ void QgsComposerMap::setOffset( double xOffset, double yOffset )
mYOffset = yOffset;
}
-void QgsComposerMap::setMapRotation( double r )
+void QgsComposerMap::setMapRotation( double rotation )
{
- mMapRotation = r;
+ mMapRotation = rotation;
mEvaluatedMapRotation = mMapRotation;
invalidateCache();
- emit mapRotationChanged( r );
+ emit mapRotationChanged( rotation );
emit itemChanged();
}
diff --git a/src/core/composer/qgscomposermap.h b/src/core/composer/qgscomposermap.h
index 3d3beed2af1..bc2deec5680 100644
--- a/src/core/composer/qgscomposermap.h
+++ b/src/core/composer/qgscomposermap.h
@@ -329,17 +329,20 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
/* reimplement setFrameStrokeWidth, so that updateBoundingRect() is called after setting the frame width */
virtual void setFrameStrokeWidth( const double strokeWidth ) override;
- /** Sets rotation for the map - this does not affect the composer item shape, only the
- * way the map is drawn within the item
+ /**
+ * Sets the \a rotation for the map - this does not affect the composer item shape, only the
+ * way the map is drawn within the item. Rotation is in degrees, clockwise.
* \since QGIS 2.1
+ * \see mapRotation()
*/
- void setMapRotation( double r );
+ void setMapRotation( double rotation );
- /** Returns the rotation used for drawing the map within the composer item
- * \returns rotation for map
+ /**
+ * Returns the rotation used for drawing the map within the composer item, in degrees clockwise.
* \param valueType controls whether the returned value is the user specified rotation,
* or the current evaluated rotation (which may be affected by data driven rotation
* settings).
+ * \see setMapRotation()
*/
double mapRotation( QgsComposerObject::PropertyValueType valueType = QgsComposerObject::EvaluatedValue ) const;
diff --git a/src/ui/composer/qgscomposermapwidgetbase.ui b/src/ui/composer/qgscomposermapwidgetbase.ui
index 58270975ff9..78396e240c4 100644
--- a/src/ui/composer/qgscomposermapwidgetbase.ui
+++ b/src/ui/composer/qgscomposermapwidgetbase.ui
@@ -104,6 +104,9 @@
°
+
+ -360.000000000000000
+
360.000000000000000
@@ -775,16 +778,9 @@
- QgsScrollArea
- QScrollArea
-
- 1
-
-
- QgsCollapsibleGroupBoxBasic
- QGroupBox
-
- 1
+ QgsPropertyOverrideButton
+ QToolButton
+ qgspropertyoverridebutton.h
QgsDoubleSpinBox
@@ -797,20 +793,27 @@
- QgsComposerItemComboBox
- QComboBox
- qgscomposeritemcombobox.h
-
-
- QgsPropertyOverrideButton
- QToolButton
- qgspropertyoverridebutton.h
+ QgsCollapsibleGroupBoxBasic
+ QGroupBox
+
+ 1
QgsBlendModeComboBox
QComboBox
+
+ QgsScrollArea
+ QScrollArea
+
+ 1
+
+
+ QgsComposerItemComboBox
+ QComboBox
+ qgscomposeritemcombobox.h
+
QgsProjectionSelectionWidget
QWidget
@@ -877,6 +880,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+