Skip to content
Permalink
Browse files

Add unit tests, standardise method names

  • Loading branch information
nyalldawson committed Dec 6, 2018
1 parent a97d335 commit 048d52654253c6ee460d5951f8b9e3a9aa911ac3
@@ -752,22 +752,22 @@ framePenSize method.
.. seealso:: :py:func:`setFrameWidth`
%End

void setGridFrameMargin( const double margin );
void setFrameMargin( const double margin );
%Docstring
Sets the grid frame margin (in layout units).
This property controls distance between the map frame and the grid frame.

.. seealso:: :py:func:`gridFrameMargin`
.. seealso:: :py:func:`frameMargin`

.. versionadded:: 3.6
%End

double gridFrameMargin() const;
double frameMargin() const;
%Docstring
Sets the grid frame Margin (in layout units).
This property controls distance between the map frame and the grid frame.

.. seealso:: :py:func:`setGridFrameMargin`
.. seealso:: :py:func:`setFrameMargin`

.. versionadded:: 3.6
%End
@@ -476,7 +476,7 @@ void QgsLayoutMapGridWidget::setGridItems()
mOffsetYSpinBox->setValue( mMapGrid->offsetY() );
mCrossWidthSpinBox->setValue( mMapGrid->crossLength() );
mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
mGridFrameMarginSpinBox->setValue( mMapGrid->gridFrameMargin() );
mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
mGridFramePenSizeSpinBox->setValue( mMapGrid->framePenSize() );
mGridFramePenColorButton->setColor( mMapGrid->framePenColor() );
mGridFrameFill1ColorButton->setColor( mMapGrid->frameFillColor1() );
@@ -533,7 +533,7 @@ void QgsLayoutMapGridWidget::setGridItems()

//grid frame
mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
mGridFrameMarginSpinBox->setValue( mMapGrid->gridFrameMargin() );
mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
QgsLayoutItemMapGrid::FrameStyle gridFrameStyle = mMapGrid->frameStyle();
mFrameStyleComboBox->setCurrentIndex( mFrameStyleComboBox->findData( gridFrameStyle ) );
switch ( gridFrameStyle )
@@ -709,7 +709,7 @@ void QgsLayoutMapGridWidget::mGridFrameMarginSpinBox_valueChanged( double val )
}

mMap->beginCommand( tr( "Change Grid Frame Margin" ) );
mMapGrid->setGridFrameMargin( val );
mMapGrid->setFrameMargin( val );
mMap->updateBoundingRect();
mMap->update();
mMap->endCommand();
@@ -729,18 +729,18 @@ class CORE_EXPORT QgsLayoutItemMapGrid : public QgsLayoutItemMapItem
/**
* Sets the grid frame margin (in layout units).
* This property controls distance between the map frame and the grid frame.
* \see gridFrameMargin()
* \see frameMargin()
* \since QGIS 3.6
*/
void setGridFrameMargin( const double margin ) { mGridFrameMargin = margin; }
void setFrameMargin( const double margin ) { mGridFrameMargin = margin; }

/**
* Sets the grid frame Margin (in layout units).
* This property controls distance between the map frame and the grid frame.
* \see setGridFrameMargin()
* \see setFrameMargin()
* \since QGIS 3.6
*/
double gridFrameMargin() const { return mGridFrameMargin; }
double frameMargin() const { return mGridFrameMargin; }

/**
* Sets the \a width of the stroke drawn in the grid frame.

0 comments on commit 048d526

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