Class: QgsDoubleBoxScaleBarRenderer

class qgis.core.QgsDoubleBoxScaleBarRenderer

Bases: QgsScaleBarRenderer

Constructor for QgsDoubleBoxScaleBarRenderer.

QgsDoubleBoxScaleBarRenderer(QgsDoubleBoxScaleBarRenderer)

Double box with alternating colors.

Methods

clone

rtype

QgsDoubleBoxScaleBarRenderer

draw

param context

drawDefaultLabels

Draws default scalebar labels using the specified settings and scaleContext to a destination render context.

firstLabelString

Returns the text used for the first label in the scalebar.

firstLabelXOffset

Returns the x-offset (in millimeters) used for the first label in the scalebar.

flags

rtype

QgsScaleBarRenderer.Flags

id

rtype

str

segmentPositions

Returns a list of positions for each segment within the scalebar.

segmentWidths

Returns a list of widths of each segment of the scalebar.

sortKey

rtype

int

visibleName

rtype

str

clone(self)QgsDoubleBoxScaleBarRenderer
Return type

QgsDoubleBoxScaleBarRenderer

draw(self, context: QgsRenderContext, settings: QgsScaleBarSettings, scaleContext: QgsScaleBarRenderer.ScaleBarContext)
Parameters
drawDefaultLabels(self, context: QgsRenderContext, settings: QgsScaleBarSettings, scaleContext: QgsScaleBarRenderer.ScaleBarContext)

Draws default scalebar labels using the specified settings and scaleContext to a destination render context.

firstLabelString(self, settings: QgsScaleBarSettings) → str

Returns the text used for the first label in the scalebar.

firstLabelXOffset(self, settings: QgsScaleBarSettings) → float

Returns the x-offset (in millimeters) used for the first label in the scalebar.

Deprecated since version Use: the version with QgsRenderContext instead.

firstLabelXOffset(self, settings: QgsScaleBarSettings, context: QgsRenderContext, scaleContext: QgsScaleBarRenderer.ScaleBarContext) -> float Returns the x-offset (in render context painter units) used for the first label in the scalebar.

New in version 3.2.

flags(self)QgsScaleBarRenderer.Flags
Return type

QgsScaleBarRenderer.Flags

id(self) → str
Return type

str

segmentPositions(self, scaleContext: QgsScaleBarRenderer.ScaleBarContext, settings: QgsScaleBarSettings) → List[float]

Returns a list of positions for each segment within the scalebar.

Deprecated since version use: the version with a QgsRenderContext instead

segmentPositions(self, context: QgsRenderContext, scaleContext: QgsScaleBarRenderer.ScaleBarContext, settings: QgsScaleBarSettings) -> List[float] Returns a list of positions for each segment within the scalebar.

New in version 3.14.

segmentWidths(self, scaleContext: QgsScaleBarRenderer.ScaleBarContext, settings: QgsScaleBarSettings) → List[float]

Returns a list of widths of each segment of the scalebar.

sortKey(self) → int
Return type

int

visibleName(self) → str
Return type

str