Skip to content

Commit 048d526

Browse files
committed
Add unit tests, standardise method names
1 parent a97d335 commit 048d526

File tree

11 files changed

+295
-11
lines changed

11 files changed

+295
-11
lines changed

python/core/auto_generated/layout/qgslayoutitemmapgrid.sip.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -752,22 +752,22 @@ framePenSize method.
752752
.. seealso:: :py:func:`setFrameWidth`
753753
%End
754754

755-
void setGridFrameMargin( const double margin );
755+
void setFrameMargin( const double margin );
756756
%Docstring
757757
Sets the grid frame margin (in layout units).
758758
This property controls distance between the map frame and the grid frame.
759759

760-
.. seealso:: :py:func:`gridFrameMargin`
760+
.. seealso:: :py:func:`frameMargin`
761761

762762
.. versionadded:: 3.6
763763
%End
764764

765-
double gridFrameMargin() const;
765+
double frameMargin() const;
766766
%Docstring
767767
Sets the grid frame Margin (in layout units).
768768
This property controls distance between the map frame and the grid frame.
769769

770-
.. seealso:: :py:func:`setGridFrameMargin`
770+
.. seealso:: :py:func:`setFrameMargin`
771771

772772
.. versionadded:: 3.6
773773
%End

src/app/layout/qgslayoutmapgridwidget.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ void QgsLayoutMapGridWidget::setGridItems()
476476
mOffsetYSpinBox->setValue( mMapGrid->offsetY() );
477477
mCrossWidthSpinBox->setValue( mMapGrid->crossLength() );
478478
mFrameWidthSpinBox->setValue( mMapGrid->frameWidth() );
479-
mGridFrameMarginSpinBox->setValue( mMapGrid->gridFrameMargin() );
479+
mGridFrameMarginSpinBox->setValue( mMapGrid->frameMargin() );
480480
mGridFramePenSizeSpinBox->setValue( mMapGrid->framePenSize() );
481481
mGridFramePenColorButton->setColor( mMapGrid->framePenColor() );
482482
mGridFrameFill1ColorButton->setColor( mMapGrid->frameFillColor1() );
@@ -533,7 +533,7 @@ void QgsLayoutMapGridWidget::setGridItems()
533533

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

711711
mMap->beginCommand( tr( "Change Grid Frame Margin" ) );
712-
mMapGrid->setGridFrameMargin( val );
712+
mMapGrid->setFrameMargin( val );
713713
mMap->updateBoundingRect();
714714
mMap->update();
715715
mMap->endCommand();

src/core/layout/qgslayoutitemmapgrid.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -729,18 +729,18 @@ class CORE_EXPORT QgsLayoutItemMapGrid : public QgsLayoutItemMapItem
729729
/**
730730
* Sets the grid frame margin (in layout units).
731731
* This property controls distance between the map frame and the grid frame.
732-
* \see gridFrameMargin()
732+
* \see frameMargin()
733733
* \since QGIS 3.6
734734
*/
735-
void setGridFrameMargin( const double margin ) { mGridFrameMargin = margin; }
735+
void setFrameMargin( const double margin ) { mGridFrameMargin = margin; }
736736

737737
/**
738738
* Sets the grid frame Margin (in layout units).
739739
* This property controls distance between the map frame and the grid frame.
740-
* \see setGridFrameMargin()
740+
* \see setFrameMargin()
741741
* \since QGIS 3.6
742742
*/
743-
double gridFrameMargin() const { return mGridFrameMargin; }
743+
double frameMargin() const { return mGridFrameMargin; }
744744

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

0 commit comments

Comments
 (0)