Class: QgsScaleBarSettings¶
-
class
qgis.core.
QgsScaleBarSettings
¶ Bases:
sip.wrapper
Constructor for QgsScaleBarSettings.
QgsScaleBarSettings(QgsScaleBarSettings)
The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with QgsScaleBarRenderer.
New in version 3.0: Enums
Methods
Returns the scalebar alignment.
Returns the spacing (margin) between the scalebar box and content in millimeters.
Returns the primary brush used for filling the scalebar.
Returns the secondary brush for the scalebar.
Returns the color used for fills in the scalebar.
Returns the secondary color used for fills in the scalebar.
Returns the font used for drawing text in the scalebar.
Returns the color used for drawing text in the scalebar.
Returns the scalebar height (in millimeters).
Returns the spacing (in millimeters) between labels and the scalebar.
Returns the cap style used for drawing lines in the scalebar.
Returns the color used for lines in the scalebar.
Returns the join style used for drawing lines in the scalebar.
Returns the line width in millimeters for lines in the scalebar.
Returns the number of map units per scale bar unit used by the scalebar.
Returns the maximum width (in millimeters) for scale bar segments.
Returns the minimum width (in millimeters) for scale bar segments.
Returns the number of segments included in the scalebar.
Returns the number of segments included in the left part of the scalebar.
Returns the pen used for drawing outlines in the scalebar.
Returns the size mode for the scale bar segments.
Sets the scalebar
alignment
.Sets the
space
(margin) between the scalebar box and content in millimeters.Sets the primary brush used for filling the scalebar.
Sets the secondary brush used for filling the scalebar.
Sets the
color
used for fills in the scalebar.Sets the secondary
color
used for fills in the scalebar.Sets the
font
used for drawing text in the scalebar.Sets the
color
used for drawing text in the scalebar.Sets the scalebar
height
(in millimeters).Sets the spacing (in millimeters) between labels and the scalebar.
Sets the cap
style
used when drawing the lines in the scalebar.Sets the
color
used for lines in the scalebar.Sets the join
style
used when drawing the lines in the scalebarSets the line
width
in millimeters for lines in the scalebar.Sets the number of map
units
per scale bar unit used by the scalebar.Sets the maximum
width
(in millimeters) for scale bar segments.Sets the minimum
width
(in millimeters) for scale bar segments.Sets the number of
segments
included in the scalebar.Sets the number of
segments
included in the left part of the scalebar.Sets the pen used for drawing outlines in the scalebar.
Sets the size
mode
for scale bar segments.Sets the text
format
used for drawing text in the scalebar.Sets the
label
for units.Sets the distance
units
used by the scalebar.Sets the number of scalebar
units
per segment.Returns the text format used for drawing text in the scalebar.
Returns the label for units.
Returns the distance units used by the scalebar.
Returns the number of scalebar units per segment.
Signals
Attributes
-
AlignLeft
= 0¶
-
AlignMiddle
= 1¶
-
AlignRight
= 2¶
-
class
Alignment
¶ Bases:
int
-
SegmentSizeFitWidth
= 1¶
-
SegmentSizeFixed
= 0¶
-
class
SegmentSizeMode
¶ Bases:
int
-
alignment
(self) → QgsScaleBarSettings.Alignment¶ Returns the scalebar alignment.
See also
-
boxContentSpace
(self) → float¶ Returns the spacing (margin) between the scalebar box and content in millimeters.
See also
-
brush
(self) → QBrush¶ Returns the primary brush used for filling the scalebar.
See also
See also
See also
-
brush2
(self) → QBrush¶ Returns the secondary brush for the scalebar. This is used for alternating color style scalebars, such as single and double box styles.
See also
See also
-
fillColor
(self) → QColor¶ Returns the color used for fills in the scalebar.
See also
See also
-
fillColor2
(self) → QColor¶ Returns the secondary color used for fills in the scalebar.
See also
See also
-
font
(self) → QFont¶ Returns the font used for drawing text in the scalebar.
See also
Deprecated since version use: textFormat() instead
-
fontColor
(self) → QColor¶ Returns the color used for drawing text in the scalebar.
See also
See also
Deprecated since version use: textFormat() instead
-
height
(self) → float¶ Returns the scalebar height (in millimeters).
See also
-
labelBarSpace
(self) → float¶ Returns the spacing (in millimeters) between labels and the scalebar.
See also
-
lineCapStyle
(self) → Qt.PenCapStyle¶ Returns the cap style used for drawing lines in the scalebar.
See also
-
lineColor
(self) → QColor¶ Returns the color used for lines in the scalebar.
See also
-
lineJoinStyle
(self) → Qt.PenJoinStyle¶ Returns the join style used for drawing lines in the scalebar.
See also
-
lineWidth
(self) → float¶ Returns the line width in millimeters for lines in the scalebar.
See also
-
mapUnitsPerScaleBarUnit
(self) → float¶ Returns the number of map units per scale bar unit used by the scalebar.
See also
-
maximumBarWidth
(self) → float¶ Returns the maximum width (in millimeters) for scale bar segments. This property is only effective if the segmentSizeMode() is set to SegmentSizeFitWidth.
See also
See also
See also
-
minimumBarWidth
(self) → float¶ Returns the minimum width (in millimeters) for scale bar segments. This property is only effective if the segmentSizeMode() is set to SegmentSizeFitWidth.
See also
See also
See also
-
numberOfSegments
(self) → int¶ Returns the number of segments included in the scalebar.
See also
See also
-
numberOfSegmentsLeft
(self) → int¶ Returns the number of segments included in the left part of the scalebar.
See also
See also
-
pen
(self) → QPen¶ Returns the pen used for drawing outlines in the scalebar.
See also
See also
-
segmentSizeMode
(self) → QgsScaleBarSettings.SegmentSizeMode¶ Returns the size mode for the scale bar segments.
See also
See also
See also
-
setAlignment
(self, alignment: QgsScaleBarSettings.Alignment)¶ Sets the scalebar
alignment
.See also
-
setBoxContentSpace
(self, space: float)¶ Sets the
space
(margin) between the scalebar box and content in millimeters.See also
-
setBrush
(self, brush: Union[QBrush, QColor, Qt.GlobalColor, QGradient])¶ Sets the primary brush used for filling the scalebar.
See also
-
setBrush2
(self, brush: Union[QBrush, QColor, Qt.GlobalColor, QGradient])¶ Sets the secondary brush used for filling the scalebar.
See also
-
setFillColor
(self, color: Union[QColor, Qt.GlobalColor])¶ Sets the
color
used for fills in the scalebar.See also
See also
-
setFillColor2
(self, color: Union[QColor, Qt.GlobalColor])¶ Sets the secondary
color
used for fills in the scalebar.See also
See also
-
setFont
(self, font: QFont)¶ Sets the
font
used for drawing text in the scalebar.See also
Deprecated since version use: setTextFormat() instead
-
setFontColor
(self, color: Union[QColor, Qt.GlobalColor])¶ Sets the
color
used for drawing text in the scalebar.See also
See also
Deprecated since version use: textFormat() instead
-
setLabelBarSpace
(self, space: float)¶ Sets the spacing (in millimeters) between labels and the scalebar.
See also
-
setLineCapStyle
(self, style: Qt.PenCapStyle)¶ Sets the cap
style
used when drawing the lines in the scalebar.See also
-
setLineColor
(self, color: Union[QColor, Qt.GlobalColor])¶ Sets the
color
used for lines in the scalebar.See also
-
setLineJoinStyle
(self, style: Qt.PenJoinStyle)¶ Sets the join
style
used when drawing the lines in the scalebarSee also
-
setLineWidth
(self, width: float)¶ Sets the line
width
in millimeters for lines in the scalebar.See also
-
setMapUnitsPerScaleBarUnit
(self, units: float)¶ Sets the number of map
units
per scale bar unit used by the scalebar.See also
-
setMaximumBarWidth
(self, width: float)¶ Sets the maximum
width
(in millimeters) for scale bar segments. This property is only effective if the segmentSizeMode() is set to SegmentSizeFitWidth.See also
See also
See also
-
setMinimumBarWidth
(self, width: float)¶ Sets the minimum
width
(in millimeters) for scale bar segments. This property is only effective if the segmentSizeMode() is set to SegmentSizeFitWidth.See also
See also
See also
-
setNumberOfSegments
(self, segments: int)¶ Sets the number of
segments
included in the scalebar.See also
See also
-
setNumberOfSegmentsLeft
(self, segments: int)¶ Sets the number of
segments
included in the left part of the scalebar.See also
See also
-
setPen
(self, pen: Union[QPen, QColor, Qt.GlobalColor])¶ Sets the pen used for drawing outlines in the scalebar.
See also
-
setSegmentSizeMode
(self, mode: QgsScaleBarSettings.SegmentSizeMode)¶ Sets the size
mode
for scale bar segments.See also
See also
See also
-
setTextFormat
(self, format: QgsTextFormat)¶ Sets the text
format
used for drawing text in the scalebar.See also
New in version 3.2.
-
setUnitLabel
(self, label: str)¶ Sets the
label
for units.See also
-
setUnits
(self, units: QgsUnitTypes.DistanceUnit)¶ Sets the distance
units
used by the scalebar.See also
-
setUnitsPerSegment
(self, units: float)¶ Sets the number of scalebar
units
per segment.See also
-
textFormat
(self) → QgsTextFormat¶ Returns the text format used for drawing text in the scalebar.
See also
New in version 3.2.
-
unitLabel
(self) → str¶ Returns the label for units.
See also
-
units
(self) → QgsUnitTypes.DistanceUnit¶ Returns the distance units used by the scalebar.
See also
-
unitsPerSegment
(self) → float¶ Returns the number of scalebar units per segment.
See also
-