Skip to content
Permalink
Browse files

Add clarification re meaning of number of subdivisions

  • Loading branch information
nyalldawson committed May 6, 2020
1 parent 4d5a8a3 commit 6e9b7ae594f5217640be5693749a6f55fb07cb1a
@@ -80,6 +80,11 @@ Sets the number of ``segments`` included in the left part of the scalebar.
%Docstring
Returns the number of subdivisions for segments included in the right part of the scalebar (only used for some scalebar types).

.. note::

The number of subdivisions represents the number of subdivision segments, not the number of subdivision lines. E.g.
if the number is 1 then NO subdivision lines will be shown.

.. seealso:: :py:func:`setNumberOfSubdivisions`

.. versionadded:: 3.14
@@ -89,6 +94,11 @@ Returns the number of subdivisions for segments included in the right part of th
%Docstring
Sets the number of ``subdivisions`` for segments included in the right part of the scalebar (only used for some scalebar types).

.. note::

The number of subdivisions represents the number of subdivision segments, not the number of subdivision lines. E.g.
if the number is 1 then NO subdivision lines will be shown.

.. seealso:: :py:func:`numberOfSubdivisions`

.. versionadded:: 3.14
@@ -101,6 +101,11 @@ Sets the number of ``segments`` included in the left part of the scalebar.
%Docstring
Returns the number of subdivisions for segments included in the right part of the scalebar (only used for some scalebar types).

.. note::

The number of subdivisions represents the number of subdivision segments, not the number of subdivision lines. E.g.
if the number is 1 then NO subdivision lines will be shown.

.. seealso:: :py:func:`setNumberOfSubdivisions`

.. versionadded:: 3.14
@@ -110,6 +115,11 @@ Returns the number of subdivisions for segments included in the right part of th
%Docstring
Sets the number of ``subdivisions`` for segments included in the right part of the scalebar (only used for some scalebar types).

.. note::

The number of subdivisions represents the number of subdivision segments, not the number of subdivision lines. E.g.
if the number is 1 then NO subdivision lines will be shown.

.. seealso:: :py:func:`numberOfSubdivisions`

.. versionadded:: 3.14
@@ -839,7 +839,7 @@ bool QgsLayoutItemScaleBar::readPropertiesFromElement( const QDomElement &itemEl
mSettings.setBoxContentSpace( itemElem.attribute( QStringLiteral( "boxContentSpace" ), QStringLiteral( "1.0" ) ).toDouble() );
mSettings.setNumberOfSegments( itemElem.attribute( QStringLiteral( "numSegments" ), QStringLiteral( "2" ) ).toInt() );
mSettings.setNumberOfSegmentsLeft( itemElem.attribute( QStringLiteral( "numSegmentsLeft" ), QStringLiteral( "0" ) ).toInt() );
mSettings.setNumberOfSubdivisions( itemElem.attribute( QStringLiteral( "numSubdivisions" ), QStringLiteral( "0" ) ).toInt() );
mSettings.setNumberOfSubdivisions( itemElem.attribute( QStringLiteral( "numSubdivisions" ), QStringLiteral( "1" ) ).toInt() );
mSettings.setSubdivisionsHeight( itemElem.attribute( QStringLiteral( "subdivisionsHeight" ), QStringLiteral( "1.5" ) ).toDouble() );
mSettings.setUnitsPerSegment( itemElem.attribute( QStringLiteral( "numUnitsPerSegment" ), QStringLiteral( "1.0" ) ).toDouble() );
mSettings.setSegmentSizeMode( static_cast<QgsScaleBarSettings::SegmentSizeMode>( itemElem.attribute( QStringLiteral( "segmentSizeMode" ), QStringLiteral( "0" ) ).toInt() ) );
@@ -84,13 +84,21 @@ class CORE_EXPORT QgsLayoutItemScaleBar: public QgsLayoutItem

/**
* Returns the number of subdivisions for segments included in the right part of the scalebar (only used for some scalebar types).
*
* \note The number of subdivisions represents the number of subdivision segments, not the number of subdivision lines. E.g.
* if the number is 1 then NO subdivision lines will be shown.
*
* \see setNumberOfSubdivisions()
* \since QGIS 3.14
*/
int numberOfSubdivisions() const { return mSettings.numberOfSubdivisions(); }

/**
* Sets the number of \a subdivisions for segments included in the right part of the scalebar (only used for some scalebar types).
*
* \note The number of subdivisions represents the number of subdivision segments, not the number of subdivision lines. E.g.
* if the number is 1 then NO subdivision lines will be shown.
*
* \see numberOfSubdivisions()
* \since QGIS 3.14
*/
@@ -122,13 +122,21 @@ class CORE_EXPORT QgsScaleBarSettings

/**
* Returns the number of subdivisions for segments included in the right part of the scalebar (only used for some scalebar types).
*
* \note The number of subdivisions represents the number of subdivision segments, not the number of subdivision lines. E.g.
* if the number is 1 then NO subdivision lines will be shown.
*
* \see setNumberOfSubdivisions()
* \since QGIS 3.14
*/
int numberOfSubdivisions() const { return mNumSubdivisions; }

/**
* Sets the number of \a subdivisions for segments included in the right part of the scalebar (only used for some scalebar types).
*
* \note The number of subdivisions represents the number of subdivision segments, not the number of subdivision lines. E.g.
* if the number is 1 then NO subdivision lines will be shown.
*
* \see numberOfSubdivisions()
* \since QGIS 3.14
*/
@@ -614,7 +622,7 @@ class CORE_EXPORT QgsScaleBarSettings
//! Number of segments on left side
int mNumSegmentsLeft = 0;
//! Number of subdivisions on right side
int mNumSubdivisions = 0;
int mNumSubdivisions = 1;
//! Height of subdivisions on right side
double mSubdivisionsHeight = 1.5;
//! Size of a segment (in map units)

0 comments on commit 6e9b7ae

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