QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsScaleBarSettings Class Reference

The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with QgsScaleBarRenderer. More...

#include <qgsscalebarsettings.h>

Public Member Functions

 QgsScaleBarSettings ()
 
 QgsScaleBarSettings (const QgsScaleBarSettings &other)
 
 ~QgsScaleBarSettings ()
 
Qgis::ScaleBarAlignment alignment () const
 Returns the scalebar alignment.
 
QgsFillSymbolalternateFillSymbol () const
 Returns the secondary fill symbol used to render the scalebar (only used for some scalebar types).
 
double boxContentSpace () const
 Returns the spacing (margin) between the scalebar box and content in millimeters.
 
Q_DECL_DEPRECATED QBrush brush () const
 Returns the primary brush used for filling the scalebar.
 
Q_DECL_DEPRECATED QBrush brush2 () const
 Returns the secondary brush for the scalebar.
 
QgsLineSymboldivisionLineSymbol () const
 Returns the line symbol used to render the scalebar divisions (only used for some scalebar types).
 
Q_DECL_DEPRECATED QColor fillColor () const
 Returns the color used for fills in the scalebar.
 
Q_DECL_DEPRECATED QColor fillColor2 () const
 Returns the secondary color used for fills in the scalebar.
 
QgsFillSymbolfillSymbol () const
 Returns the primary fill symbol used to render the scalebar (only used for some scalebar types).
 
Q_DECL_DEPRECATED QFont font () const
 Returns the font used for drawing text in the scalebar.
 
Q_DECL_DEPRECATED QColor fontColor () const
 Returns the color used for drawing text in the scalebar.
 
double height () const
 Returns the scalebar height (in millimeters).
 
double labelBarSpace () const
 Returns the spacing (in millimeters) between labels and the scalebar.
 
Qgis::ScaleBarDistanceLabelHorizontalPlacement labelHorizontalPlacement () const
 Returns the horizontal placement of text labels.
 
Qgis::ScaleBarDistanceLabelVerticalPlacement labelVerticalPlacement () const
 Returns the vertical placement of text labels.
 
Q_DECL_DEPRECATED Qt::PenCapStyle lineCapStyle () const
 Returns the cap style used for drawing lines in the scalebar.
 
Q_DECL_DEPRECATED QColor lineColor () const
 Returns the color used for lines in the scalebar.
 
Q_DECL_DEPRECATED Qt::PenJoinStyle lineJoinStyle () const
 Returns the join style used for drawing lines in the scalebar.
 
QgsLineSymbollineSymbol () const
 Returns the line symbol used to render the scalebar (only used for some scalebar types).
 
Q_DECL_DEPRECATED double lineWidth () const
 Returns the line width in millimeters for lines in the scalebar.
 
double mapUnitsPerScaleBarUnit () const
 Returns the number of map units per scale bar unit used by the scalebar.
 
double maximumBarWidth () const
 Returns the maximum width (in millimeters) for scale bar segments.
 
double minimumBarWidth () const
 Returns the minimum width (in millimeters) for scale bar segments.
 
int numberOfSegments () const
 Returns the number of segments included in the scalebar.
 
int numberOfSegmentsLeft () const
 Returns the number of segments included in the left part of the scalebar.
 
int numberOfSubdivisions () const
 Returns the number of subdivisions for segments included in the right part of the scalebar (only used for some scalebar types).
 
const QgsNumericFormatnumericFormat () const
 Returns the numeric format used for numbers in the scalebar.
 
QgsScaleBarSettingsoperator= (const QgsScaleBarSettings &other)
 
Q_DECL_DEPRECATED QPen pen () const
 Returns the pen used for drawing outlines in the scalebar.
 
Qgis::ScaleBarSegmentSizeMode segmentSizeMode () const
 Returns the size mode for the scale bar segments.
 
void setAlignment (Qgis::ScaleBarAlignment alignment)
 Sets the scalebar alignment.
 
void setAlternateFillSymbol (QgsFillSymbol *symbol)
 Sets the secondary fill symbol used to render the scalebar (only used for some scalebar types).
 
void setBoxContentSpace (double space)
 Sets the space (margin) between the scalebar box and content in millimeters.
 
Q_DECL_DEPRECATED void setBrush (const QBrush &brush)
 Sets the primary brush used for filling the scalebar.
 
Q_DECL_DEPRECATED void setBrush2 (const QBrush &brush)
 Sets the secondary brush used for filling the scalebar.
 
void setDivisionLineSymbol (QgsLineSymbol *symbol)
 Sets the line symbol used to render the scalebar divisions (only used for some scalebar types).
 
Q_DECL_DEPRECATED void setFillColor (const QColor &color)
 Sets the color used for fills in the scalebar.
 
Q_DECL_DEPRECATED void setFillColor2 (const QColor &color)
 Sets the secondary color used for fills in the scalebar.
 
void setFillSymbol (QgsFillSymbol *symbol)
 Sets the primary fill symbol used to render the scalebar (only used for some scalebar types).
 
Q_DECL_DEPRECATED void setFont (const QFont &font)
 Sets the font used for drawing text in the scalebar.
 
Q_DECL_DEPRECATED void setFontColor (const QColor &color)
 Sets the color used for drawing text in the scalebar.
 
void setHeight (double height)
 Sets the scalebar height (in millimeters).
 
void setLabelBarSpace (double space)
 Sets the spacing (in millimeters) between labels and the scalebar.
 
void setLabelHorizontalPlacement (Qgis::ScaleBarDistanceLabelHorizontalPlacement placement)
 Sets the horizontal placement of text labels.
 
void setLabelVerticalPlacement (Qgis::ScaleBarDistanceLabelVerticalPlacement placement)
 Sets the vertical placement of text labels.
 
Q_DECL_DEPRECATED void setLineCapStyle (Qt::PenCapStyle style)
 Sets the cap style used when drawing the lines in the scalebar.
 
Q_DECL_DEPRECATED void setLineColor (const QColor &color)
 Sets the color used for lines in the scalebar.
 
Q_DECL_DEPRECATED void setLineJoinStyle (Qt::PenJoinStyle style)
 Sets the join style used when drawing the lines in the scalebar.
 
void setLineSymbol (QgsLineSymbol *symbol)
 Sets the line symbol used to render the scalebar (only used for some scalebar types).
 
Q_DECL_DEPRECATED void setLineWidth (double width)
 Sets the line width in millimeters for lines in the scalebar.
 
void setMapUnitsPerScaleBarUnit (double units)
 Sets the number of map units per scale bar unit used by the scalebar.
 
void setMaximumBarWidth (double width)
 Sets the maximum width (in millimeters) for scale bar segments.
 
void setMinimumBarWidth (double width)
 Sets the minimum width (in millimeters) for scale bar segments.
 
void setNumberOfSegments (int segments)
 Sets the number of segments included in the scalebar.
 
void setNumberOfSegmentsLeft (int segments)
 Sets the number of segments included in the left part of the scalebar.
 
void setNumberOfSubdivisions (int subdivisions)
 Sets the number of subdivisions for segments included in the right part of the scalebar (only used for some scalebar types).
 
void setNumericFormat (QgsNumericFormat *format)
 Sets the numeric format used for numbers in the scalebar.
 
Q_DECL_DEPRECATED void setPen (const QPen &pen)
 Sets the pen used for drawing outlines in the scalebar.
 
void setSegmentSizeMode (Qgis::ScaleBarSegmentSizeMode mode)
 Sets the size mode for scale bar segments.
 
void setSubdivisionLineSymbol (QgsLineSymbol *symbol)
 Sets the line symbol used to render the scalebar subdivisions (only used for some scalebar types).
 
void setSubdivisionsHeight (double height)
 Sets the scalebar subdivisions height (in millimeters) for segments included in the right part of the scalebar (only used for some scalebar types).
 
void setTextFormat (const QgsTextFormat &format)
 Sets the text format used for drawing text in the scalebar.
 
void setUnitLabel (const QString &label)
 Sets the label for units.
 
void setUnits (Qgis::DistanceUnit units)
 Sets the distance units used by the scalebar.
 
void setUnitsPerSegment (double units)
 Sets the number of scalebar units per segment.
 
QgsLineSymbolsubdivisionLineSymbol () const
 Returns the line symbol used to render the scalebar subdivisions (only used for some scalebar types).
 
double subdivisionsHeight () const
 Returns the scalebar subdivisions height (in millimeters) for segments included in the right part of the scalebar (only used for some scalebar types).
 
QgsTextFormattextFormat ()
 Returns the text format used for drawing text in the scalebar.
 
QgsTextFormat textFormat () const
 Returns the text format used for drawing text in the scalebar.
 
QString unitLabel () const
 Returns the label for units.
 
Qgis::DistanceUnit units () const
 Returns the distance units used by the scalebar.
 
double unitsPerSegment () const
 Returns the number of scalebar units per segment.
 

Detailed Description

The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with QgsScaleBarRenderer.

Definition at line 38 of file qgsscalebarsettings.h.

Constructor & Destructor Documentation

◆ QgsScaleBarSettings() [1/2]

QgsScaleBarSettings::QgsScaleBarSettings ( )

Definition at line 26 of file qgsscalebarsettings.cpp.

◆ ~QgsScaleBarSettings()

QgsScaleBarSettings::~QgsScaleBarSettings ( )
default

◆ QgsScaleBarSettings() [2/2]

QgsScaleBarSettings::QgsScaleBarSettings ( const QgsScaleBarSettings other)

Definition at line 60 of file qgsscalebarsettings.cpp.

Member Function Documentation

◆ alignment()

Qgis::ScaleBarAlignment QgsScaleBarSettings::alignment ( ) const
inline

Returns the scalebar alignment.

See also
setAlignment()

Definition at line 569 of file qgsscalebarsettings.h.

◆ alternateFillSymbol()

QgsFillSymbol * QgsScaleBarSettings::alternateFillSymbol ( ) const

Returns the secondary fill symbol used to render the scalebar (only used for some scalebar types).

Ownership is not transferred.

See also
setAlternateFillSymbol()
fillSymbol()
Since
QGIS 3.14

Definition at line 232 of file qgsscalebarsettings.cpp.

◆ boxContentSpace()

double QgsScaleBarSettings::boxContentSpace ( ) const
inline

Returns the spacing (margin) between the scalebar box and content in millimeters.

See also
setBoxContentSpace()

Definition at line 557 of file qgsscalebarsettings.h.

◆ brush()

QBrush QgsScaleBarSettings::brush ( ) const

Returns the primary brush used for filling the scalebar.

See also
setBrush()
brush2()
pen()
Deprecated:
QGIS 3.40. Use fillSymbol() instead.

Definition at line 242 of file qgsscalebarsettings.cpp.

◆ brush2()

QBrush QgsScaleBarSettings::brush2 ( ) const

Returns the secondary brush for the scalebar.

This is used for alternating color style scalebars, such as single and double box styles.

See also
setBrush2()
brush()
Deprecated:
QGIS 3.40. Use alternateFillSymbol() instead.

Definition at line 263 of file qgsscalebarsettings.cpp.

◆ divisionLineSymbol()

QgsLineSymbol * QgsScaleBarSettings::divisionLineSymbol ( ) const

Returns the line symbol used to render the scalebar divisions (only used for some scalebar types).

Ownership is not transferred.

See also
setDivisionLineSymbol()
lineSymbol()
subdivisionLineSymbol()
Since
QGIS 3.14

Definition at line 202 of file qgsscalebarsettings.cpp.

◆ fillColor()

QColor QgsScaleBarSettings::fillColor ( ) const

Returns the color used for fills in the scalebar.

See also
setFillColor()
fillColor2()
Deprecated:
QGIS 3.40. Use fillSymbol() instead.

Definition at line 118 of file qgsscalebarsettings.cpp.

◆ fillColor2()

QColor QgsScaleBarSettings::fillColor2 ( ) const

Returns the secondary color used for fills in the scalebar.

See also
setFillColor2()
fillColor()
Deprecated:
QGIS 3.40. Use alternateFillSymbol() instead.

Definition at line 128 of file qgsscalebarsettings.cpp.

◆ fillSymbol()

QgsFillSymbol * QgsScaleBarSettings::fillSymbol ( ) const

Returns the primary fill symbol used to render the scalebar (only used for some scalebar types).

Ownership is not transferred.

See also
setFillSymbol()
alternateFillSymbol()
Since
QGIS 3.14

Definition at line 222 of file qgsscalebarsettings.cpp.

◆ font()

Q_DECL_DEPRECATED QFont QgsScaleBarSettings::font ( ) const
inline

Returns the font used for drawing text in the scalebar.

See also
setFont()
Deprecated:
QGIS 3.40. Use textFormat() instead.

Definition at line 244 of file qgsscalebarsettings.h.

◆ fontColor()

Q_DECL_DEPRECATED QColor QgsScaleBarSettings::fontColor ( ) const
inline

Returns the color used for drawing text in the scalebar.

See also
setFontColor()
font()
Deprecated:
QGIS 3.40. Use textFormat() instead.

Definition at line 272 of file qgsscalebarsettings.h.

◆ height()

double QgsScaleBarSettings::height ( ) const
inline

Returns the scalebar height (in millimeters).

See also
setHeight()

Definition at line 505 of file qgsscalebarsettings.h.

◆ labelBarSpace()

double QgsScaleBarSettings::labelBarSpace ( ) const
inline

Returns the spacing (in millimeters) between labels and the scalebar.

See also
setLabelBarSpace()

Definition at line 517 of file qgsscalebarsettings.h.

◆ labelHorizontalPlacement()

Qgis::ScaleBarDistanceLabelHorizontalPlacement QgsScaleBarSettings::labelHorizontalPlacement ( ) const
inline

Returns the horizontal placement of text labels.

See also
setLabelHorizontalPlacement()
Since
QGIS 3.10

Definition at line 544 of file qgsscalebarsettings.h.

◆ labelVerticalPlacement()

Qgis::ScaleBarDistanceLabelVerticalPlacement QgsScaleBarSettings::labelVerticalPlacement ( ) const
inline

Returns the vertical placement of text labels.

See also
setLabelVerticalPlacement()
Since
QGIS 3.10

Definition at line 530 of file qgsscalebarsettings.h.

◆ lineCapStyle()

Qt::PenCapStyle QgsScaleBarSettings::lineCapStyle ( ) const

Returns the cap style used for drawing lines in the scalebar.

See also
setLineCapStyle()
Deprecated:
QGIS 3.40. Use lineSymbol() instead.

Definition at line 304 of file qgsscalebarsettings.cpp.

◆ lineColor()

QColor QgsScaleBarSettings::lineColor ( ) const

Returns the color used for lines in the scalebar.

See also
setLineColor()
Deprecated:
QGIS 3.40. Use lineSymbol() instead.

Definition at line 138 of file qgsscalebarsettings.cpp.

◆ lineJoinStyle()

Qt::PenJoinStyle QgsScaleBarSettings::lineJoinStyle ( ) const

Returns the join style used for drawing lines in the scalebar.

See also
setLineJoinStyle()
Deprecated:
QGIS 3.40. Use lineSymbol() instead.

Definition at line 284 of file qgsscalebarsettings.cpp.

◆ lineSymbol()

QgsLineSymbol * QgsScaleBarSettings::lineSymbol ( ) const

Returns the line symbol used to render the scalebar (only used for some scalebar types).

Ownership is not transferred.

See also
setLineSymbol()
divisionLineSymbol()
subdivisionLineSymbol()
Since
QGIS 3.14

Definition at line 192 of file qgsscalebarsettings.cpp.

◆ lineWidth()

double QgsScaleBarSettings::lineWidth ( ) const

Returns the line width in millimeters for lines in the scalebar.

See also
setLineWidth()
Deprecated:
QGIS 3.40. Use lineSymbol() instead.

Definition at line 151 of file qgsscalebarsettings.cpp.

◆ mapUnitsPerScaleBarUnit()

double QgsScaleBarSettings::mapUnitsPerScaleBarUnit ( ) const
inline

Returns the number of map units per scale bar unit used by the scalebar.

See also
setMapUnitsPerScaleBarUnit()

Definition at line 198 of file qgsscalebarsettings.h.

◆ maximumBarWidth()

double QgsScaleBarSettings::maximumBarWidth ( ) const
inline

Returns the maximum width (in millimeters) for scale bar segments.

This property is only effective if the segmentSizeMode() is set to SegmentSizeFitWidth.

See also
segmentSizeMode()
setMaximumBarWidth()
minimumBarWidth()

Definition at line 170 of file qgsscalebarsettings.h.

◆ minimumBarWidth()

double QgsScaleBarSettings::minimumBarWidth ( ) const
inline

Returns the minimum width (in millimeters) for scale bar segments.

This property is only effective if the segmentSizeMode() is set to SegmentSizeFitWidth.

See also
segmentSizeMode()
setMinimumBarWidth()
maximumBarWidth()

Definition at line 150 of file qgsscalebarsettings.h.

◆ numberOfSegments()

int QgsScaleBarSettings::numberOfSegments ( ) const
inline

Returns the number of segments included in the scalebar.

See also
setNumberOfSegments()
numberOfSegmentsLeft()

Definition at line 55 of file qgsscalebarsettings.h.

◆ numberOfSegmentsLeft()

int QgsScaleBarSettings::numberOfSegmentsLeft ( ) const
inline

Returns the number of segments included in the left part of the scalebar.

See also
setNumberOfSegmentsLeft()
numberOfSegments()

Definition at line 69 of file qgsscalebarsettings.h.

◆ numberOfSubdivisions()

int QgsScaleBarSettings::numberOfSubdivisions ( ) const
inline

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 also
setNumberOfSubdivisions()
Since
QGIS 3.14

Definition at line 87 of file qgsscalebarsettings.h.

◆ numericFormat()

const QgsNumericFormat * QgsScaleBarSettings::numericFormat ( ) const

Returns the numeric format used for numbers in the scalebar.

See also
setNumericFormat()
Since
QGIS 3.12

Definition at line 324 of file qgsscalebarsettings.cpp.

◆ operator=()

QgsScaleBarSettings & QgsScaleBarSettings::operator= ( const QgsScaleBarSettings other)

Definition at line 89 of file qgsscalebarsettings.cpp.

◆ pen()

QPen QgsScaleBarSettings::pen ( ) const

Returns the pen used for drawing outlines in the scalebar.

See also
setPen()
brush()
Deprecated:
QGIS 3.40. Use lineSymbol() instead.

Definition at line 165 of file qgsscalebarsettings.cpp.

◆ segmentSizeMode()

Qgis::ScaleBarSegmentSizeMode QgsScaleBarSettings::segmentSizeMode ( ) const
inline

Returns the size mode for the scale bar segments.

See also
setSegmentSizeMode()
minimumBarWidth()
maximumBarWidth()

Definition at line 132 of file qgsscalebarsettings.h.

◆ setAlignment()

void QgsScaleBarSettings::setAlignment ( Qgis::ScaleBarAlignment  alignment)
inline

Sets the scalebar alignment.

See also
alignment()

Definition at line 575 of file qgsscalebarsettings.h.

◆ setAlternateFillSymbol()

void QgsScaleBarSettings::setAlternateFillSymbol ( QgsFillSymbol symbol)

Sets the secondary fill symbol used to render the scalebar (only used for some scalebar types).

Ownership of symbol is transferred to the scalebar.

See also
alternateFillSymbol()
setFillSymbol()
Since
QGIS 3.14

Definition at line 237 of file qgsscalebarsettings.cpp.

◆ setBoxContentSpace()

void QgsScaleBarSettings::setBoxContentSpace ( double  space)
inline

Sets the space (margin) between the scalebar box and content in millimeters.

See also
boxContentSpace()

Definition at line 563 of file qgsscalebarsettings.h.

◆ setBrush()

void QgsScaleBarSettings::setBrush ( const QBrush &  brush)

Sets the primary brush used for filling the scalebar.

See also
brush()
Deprecated:
QGIS 3.40. Use setFillSymbol() instead.

Definition at line 254 of file qgsscalebarsettings.cpp.

◆ setBrush2()

void QgsScaleBarSettings::setBrush2 ( const QBrush &  brush)

Sets the secondary brush used for filling the scalebar.

See also
brush()
Deprecated:
QGIS 3.40. Use setAlternateFillSymbol() instead.

Definition at line 275 of file qgsscalebarsettings.cpp.

◆ setDivisionLineSymbol()

void QgsScaleBarSettings::setDivisionLineSymbol ( QgsLineSymbol symbol)

Sets the line symbol used to render the scalebar divisions (only used for some scalebar types).

Ownership of symbol is transferred to the scalebar.

See also
divisionLineSymbol()
setLineSymbol()
setSubdivisionLineSymbol()
Since
QGIS 3.14

Definition at line 207 of file qgsscalebarsettings.cpp.

◆ setFillColor()

void QgsScaleBarSettings::setFillColor ( const QColor &  color)

Sets the color used for fills in the scalebar.

See also
fillColor()
setFillColor2()
Deprecated:
QGIS 3.40. Use setFillSymbol() instead.

Definition at line 123 of file qgsscalebarsettings.cpp.

◆ setFillColor2()

void QgsScaleBarSettings::setFillColor2 ( const QColor &  color)

Sets the secondary color used for fills in the scalebar.

See also
fillColor2()
setFillColor2()
Deprecated:
QGIS 3.40. Use setAlternateFillSymbol() instead.

Definition at line 133 of file qgsscalebarsettings.cpp.

◆ setFillSymbol()

void QgsScaleBarSettings::setFillSymbol ( QgsFillSymbol symbol)

Sets the primary fill symbol used to render the scalebar (only used for some scalebar types).

Ownership of symbol is transferred to the scalebar.

See also
fillSymbol()
setAlternateFillSymbol()
Since
QGIS 3.14

Definition at line 227 of file qgsscalebarsettings.cpp.

◆ setFont()

Q_DECL_DEPRECATED void QgsScaleBarSettings::setFont ( const QFont &  font)
inline

Sets the font used for drawing text in the scalebar.

See also
font()
Deprecated:
QGIS 3.40. Use setTextFormat() instead.

Definition at line 251 of file qgsscalebarsettings.h.

◆ setFontColor()

Q_DECL_DEPRECATED void QgsScaleBarSettings::setFontColor ( const QColor &  color)
inline

Sets the color used for drawing text in the scalebar.

See also
fontColor()
setFont()
Deprecated:
QGIS 3.40. Use textFormat() instead.

Definition at line 280 of file qgsscalebarsettings.h.

◆ setHeight()

void QgsScaleBarSettings::setHeight ( double  height)
inline

Sets the scalebar height (in millimeters).

See also
height()

Definition at line 511 of file qgsscalebarsettings.h.

◆ setLabelBarSpace()

void QgsScaleBarSettings::setLabelBarSpace ( double  space)
inline

Sets the spacing (in millimeters) between labels and the scalebar.

See also
labelBarSpace()

Definition at line 523 of file qgsscalebarsettings.h.

◆ setLabelHorizontalPlacement()

void QgsScaleBarSettings::setLabelHorizontalPlacement ( Qgis::ScaleBarDistanceLabelHorizontalPlacement  placement)
inline

Sets the horizontal placement of text labels.

See also
labelHorizontalPlacement()
Since
QGIS 3.10

Definition at line 551 of file qgsscalebarsettings.h.

◆ setLabelVerticalPlacement()

void QgsScaleBarSettings::setLabelVerticalPlacement ( Qgis::ScaleBarDistanceLabelVerticalPlacement  placement)
inline

Sets the vertical placement of text labels.

See also
labelVerticalPlacement()
Since
QGIS 3.10

Definition at line 537 of file qgsscalebarsettings.h.

◆ setLineCapStyle()

void QgsScaleBarSettings::setLineCapStyle ( Qt::PenCapStyle  style)

Sets the cap style used when drawing the lines in the scalebar.

See also
lineCapStyle()
Deprecated:
QGIS 3.40. Use setLineSymbol() instead.

Definition at line 313 of file qgsscalebarsettings.cpp.

◆ setLineColor()

void QgsScaleBarSettings::setLineColor ( const QColor &  color)

Sets the color used for lines in the scalebar.

See also
lineColor()
Deprecated:
QGIS 3.40. Use setLineSymbol() instead.

Definition at line 143 of file qgsscalebarsettings.cpp.

◆ setLineJoinStyle()

void QgsScaleBarSettings::setLineJoinStyle ( Qt::PenJoinStyle  style)

Sets the join style used when drawing the lines in the scalebar.

See also
lineJoinStyle()
Deprecated:
QGIS 3.40. Use setLineSymbol() instead.

Definition at line 293 of file qgsscalebarsettings.cpp.

◆ setLineSymbol()

void QgsScaleBarSettings::setLineSymbol ( QgsLineSymbol symbol)

Sets the line symbol used to render the scalebar (only used for some scalebar types).

Ownership of symbol is transferred to the scalebar.

See also
lineSymbol()
setDivisionLineSymbol()
setSubdivisionLineSymbol()
Since
QGIS 3.14

Definition at line 197 of file qgsscalebarsettings.cpp.

◆ setLineWidth()

void QgsScaleBarSettings::setLineWidth ( double  width)

Sets the line width in millimeters for lines in the scalebar.

See also
lineWidth()
Deprecated:
QGIS 3.40. Use setLineSymbol() instead.

Definition at line 156 of file qgsscalebarsettings.cpp.

◆ setMapUnitsPerScaleBarUnit()

void QgsScaleBarSettings::setMapUnitsPerScaleBarUnit ( double  units)
inline

Sets the number of map units per scale bar unit used by the scalebar.

See also
mapUnitsPerScaleBarUnit()

Definition at line 204 of file qgsscalebarsettings.h.

◆ setMaximumBarWidth()

void QgsScaleBarSettings::setMaximumBarWidth ( double  width)
inline

Sets the maximum width (in millimeters) for scale bar segments.

This property is only effective if the segmentSizeMode() is set to SegmentSizeFitWidth.

See also
minimumBarWidth()
setMinimumBarWidth()
setSegmentSizeMode()

Definition at line 180 of file qgsscalebarsettings.h.

◆ setMinimumBarWidth()

void QgsScaleBarSettings::setMinimumBarWidth ( double  width)
inline

Sets the minimum width (in millimeters) for scale bar segments.

This property is only effective if the segmentSizeMode() is set to SegmentSizeFitWidth.

See also
minimumBarWidth()
setMaximumBarWidth()
setSegmentSizeMode()

Definition at line 160 of file qgsscalebarsettings.h.

◆ setNumberOfSegments()

void QgsScaleBarSettings::setNumberOfSegments ( int  segments)
inline

Sets the number of segments included in the scalebar.

See also
numberOfSegments()
setNumberOfSegmentsLeft()

Definition at line 62 of file qgsscalebarsettings.h.

◆ setNumberOfSegmentsLeft()

void QgsScaleBarSettings::setNumberOfSegmentsLeft ( int  segments)
inline

Sets the number of segments included in the left part of the scalebar.

See also
numberOfSegmentsLeft()
setNumberOfSegments()

Definition at line 76 of file qgsscalebarsettings.h.

◆ setNumberOfSubdivisions()

void QgsScaleBarSettings::setNumberOfSubdivisions ( int  subdivisions)
inline

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.
See also
numberOfSubdivisions()
Since
QGIS 3.14

Definition at line 98 of file qgsscalebarsettings.h.

◆ setNumericFormat()

void QgsScaleBarSettings::setNumericFormat ( QgsNumericFormat format)

Sets the numeric format used for numbers in the scalebar.

Ownership of format is transferred to the settings.

See also
numericFormat()
Since
QGIS 3.12

Definition at line 329 of file qgsscalebarsettings.cpp.

◆ setPen()

void QgsScaleBarSettings::setPen ( const QPen &  pen)

Sets the pen used for drawing outlines in the scalebar.

See also
pen()
Deprecated:
QGIS 3.40. Use setLineSymbol() instead.

Definition at line 177 of file qgsscalebarsettings.cpp.

◆ setSegmentSizeMode()

void QgsScaleBarSettings::setSegmentSizeMode ( Qgis::ScaleBarSegmentSizeMode  mode)
inline

Sets the size mode for scale bar segments.

See also
segmentSizeMode()
setMinimumBarWidth()
setMaximumBarWidth()

Definition at line 140 of file qgsscalebarsettings.h.

◆ setSubdivisionLineSymbol()

void QgsScaleBarSettings::setSubdivisionLineSymbol ( QgsLineSymbol symbol)

Sets the line symbol used to render the scalebar subdivisions (only used for some scalebar types).

Ownership of symbol is transferred to the scalebar.

See also
subdivisionLineSymbol()
setLineSymbol()
setDivisionLineSymbol()
Since
QGIS 3.14

Definition at line 217 of file qgsscalebarsettings.cpp.

◆ setSubdivisionsHeight()

void QgsScaleBarSettings::setSubdivisionsHeight ( double  height)
inline

Sets the scalebar subdivisions height (in millimeters) for segments included in the right part of the scalebar (only used for some scalebar types).

See also
subdivisionsHeight()
Since
QGIS 3.14

Definition at line 112 of file qgsscalebarsettings.h.

◆ setTextFormat()

void QgsScaleBarSettings::setTextFormat ( const QgsTextFormat format)
inline

Sets the text format used for drawing text in the scalebar.

See also
textFormat()
Since
QGIS 3.2

Definition at line 237 of file qgsscalebarsettings.h.

◆ setUnitLabel()

void QgsScaleBarSettings::setUnitLabel ( const QString &  label)
inline

Sets the label for units.

See also
unitLabel()

Definition at line 216 of file qgsscalebarsettings.h.

◆ setUnits()

void QgsScaleBarSettings::setUnits ( Qgis::DistanceUnit  units)
inline

Sets the distance units used by the scalebar.

See also
units()

Definition at line 192 of file qgsscalebarsettings.h.

◆ setUnitsPerSegment()

void QgsScaleBarSettings::setUnitsPerSegment ( double  units)
inline

Sets the number of scalebar units per segment.

See also
unitsPerSegment()

Definition at line 124 of file qgsscalebarsettings.h.

◆ subdivisionLineSymbol()

QgsLineSymbol * QgsScaleBarSettings::subdivisionLineSymbol ( ) const

Returns the line symbol used to render the scalebar subdivisions (only used for some scalebar types).

Ownership is not transferred.

See also
setSubdivisionLineSymbol()
lineSymbol()
divisionLineSymbol()
Since
QGIS 3.14

Definition at line 212 of file qgsscalebarsettings.cpp.

◆ subdivisionsHeight()

double QgsScaleBarSettings::subdivisionsHeight ( ) const
inline

Returns the scalebar subdivisions height (in millimeters) for segments included in the right part of the scalebar (only used for some scalebar types).

See also
setSubdivisionsHeight()
Since
QGIS 3.14

Definition at line 105 of file qgsscalebarsettings.h.

◆ textFormat() [1/2]

QgsTextFormat & QgsScaleBarSettings::textFormat ( )
inline

Returns the text format used for drawing text in the scalebar.

See also
setTextFormat()
Since
QGIS 3.2

Definition at line 223 of file qgsscalebarsettings.h.

◆ textFormat() [2/2]

QgsTextFormat QgsScaleBarSettings::textFormat ( ) const
inline

Returns the text format used for drawing text in the scalebar.

See also
setTextFormat()
Since
QGIS 3.2

Definition at line 230 of file qgsscalebarsettings.h.

◆ unitLabel()

QString QgsScaleBarSettings::unitLabel ( ) const
inline

Returns the label for units.

See also
setUnitLabel()

Definition at line 210 of file qgsscalebarsettings.h.

◆ units()

Qgis::DistanceUnit QgsScaleBarSettings::units ( ) const
inline

Returns the distance units used by the scalebar.

See also
setUnits()

Definition at line 186 of file qgsscalebarsettings.h.

◆ unitsPerSegment()

double QgsScaleBarSettings::unitsPerSegment ( ) const
inline

Returns the number of scalebar units per segment.

See also
setUnitsPerSegment()

Definition at line 118 of file qgsscalebarsettings.h.


The documentation for this class was generated from the following files: