17#ifndef QGSSCALEBARSETTINGS_H
18#define QGSSCALEBARSETTINGS_H
253 mTextFormat.setFont(
font );
254 if (
font.pointSizeF() > 0 )
256 mTextFormat.setSize(
font.pointSizeF() );
259 else if (
font.pixelSize() > 0 )
261 mTextFormat.setSize(
font.pixelSize() );
296 Q_DECL_DEPRECATED
void setFillColor( const QColor &color )
SIP_DEPRECATED;
312 Q_DECL_DEPRECATED
void setFillColor2( const QColor &color )
SIP_DEPRECATED;
326 Q_DECL_DEPRECATED
void setLineColor( const QColor &color )
SIP_DEPRECATED;
340 Q_DECL_DEPRECATED
void setLineWidth(
double width )
SIP_DEPRECATED;
483 Q_DECL_DEPRECATED
void setBrush( const QBrush &brush )
SIP_DEPRECATED;
499 Q_DECL_DEPRECATED
void setBrush2( const QBrush &brush )
SIP_DEPRECATED;
505 double height()
const {
return mHeight; }
598 Q_DECL_DEPRECATED Qt::PenJoinStyle lineJoinStyle() const
SIP_DEPRECATED;
605 Q_DECL_DEPRECATED
void setLineJoinStyle( Qt::PenJoinStyle style )
SIP_DEPRECATED;
612 Q_DECL_DEPRECATED Qt::PenCapStyle lineCapStyle() const
SIP_DEPRECATED;
619 Q_DECL_DEPRECATED
void setLineCapStyle( Qt::PenCapStyle style )
SIP_DEPRECATED;
641 int mNumSegments = 2;
643 int mNumSegmentsLeft = 0;
645 int mNumSubdivisions = 1;
647 double mSubdivisionsHeight = 1.5;
649 double mNumUnitsPerSegment = 0;
651 double mNumMapUnitsPerScaleBarUnit = 1.0;
653 Qgis::ScaleBarSegmentSizeMode mSegmentSizeMode =
Qgis::ScaleBarSegmentSizeMode::Fixed;
655 double mMinBarWidth = 50.0;
657 double mMaxBarWidth = 150.0;
660 QString mUnitLabeling;
666 double mHeight = 3.0;
675 double mLabelBarSpace = 3.0;
677 Qgis::ScaleBarDistanceLabelVerticalPlacement mLabelVerticalPlacement =
Qgis::ScaleBarDistanceLabelVerticalPlacement::AboveSegment;
679 Qgis::ScaleBarDistanceLabelHorizontalPlacement mLabelHorizontalPlacement =
Qgis::ScaleBarDistanceLabelHorizontalPlacement::CenteredEdge;
681 Qgis::ScaleBarUnitLabelPlacements mUnitLabelPlacements =
Qgis::ScaleBarUnitLabelPlacement::AfterLastDistanceLabel;
684 double mBoxContentSpace = 1.0;
686 Qgis::ScaleBarAlignment mAlignment =
Qgis::ScaleBarAlignment::
Left;
688 Qgis::DistanceUnit mUnits =
Qgis::DistanceUnit::Meters;
Provides global constants and enumerations for use throughout the application.
ScaleBarDistanceLabelHorizontalPlacement
Scale bar distance label horizontal placement.
ScaleBarDistanceLabelVerticalPlacement
Scale bar distance label vertical placement.
ScaleBarAlignment
Scalebar alignment.
DistanceUnit
Units of distance.
QFlags< ScaleBarUnitLabelPlacement > ScaleBarUnitLabelPlacements
Available placement options for a scale bar's unit label.
@ Points
Points (e.g., for font sizes).
ScaleBarSegmentSizeMode
Modes for setting size for scale bar segments.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
Qgis::ScaleBarAlignment alignment() const
Returns the scalebar alignment.
double subdivisionsHeight() const
Returns the scalebar subdivisions height (in millimeters) for segments included in the right part of ...
int numberOfSegments() const
Returns the number of segments included in the scalebar.
double maximumBarWidth() const
Returns the maximum width (in millimeters) for scale bar segments.
Qgis::ScaleBarUnitLabelPlacements unitLabelPlacements() const
Returns the placements for unit labels.
void setLabelHorizontalPlacement(Qgis::ScaleBarDistanceLabelHorizontalPlacement placement)
Sets the horizontal placement of text labels.
Qgis::ScaleBarDistanceLabelVerticalPlacement labelVerticalPlacement() const
Returns the vertical placement of text labels.
double unitsPerSegment() const
Returns the number of scalebar units per segment.
Q_DECL_DEPRECATED QColor fontColor() const
Returns the color used for drawing text in the scalebar.
QgsTextFormat & textFormat()
Returns the text format used for drawing text in the scalebar.
void setUnitLabel(const QString &label)
Sets the label for units.
void setSegmentSizeMode(Qgis::ScaleBarSegmentSizeMode mode)
Sets the size mode for scale bar segments.
void setBoxContentSpace(double space)
Sets the space (margin) between the scalebar box and content in millimeters.
double boxContentSpace() const
Returns the spacing (margin) between the scalebar box and content in millimeters.
void setHeight(double height)
Sets the scalebar height (in millimeters).
Qgis::ScaleBarSegmentSizeMode segmentSizeMode() const
Returns the size mode for the scale bar segments.
void setLabelVerticalPlacement(Qgis::ScaleBarDistanceLabelVerticalPlacement placement)
Sets the vertical placement of text labels.
void setUnitLabelPlacements(Qgis::ScaleBarUnitLabelPlacements placements)
Sets the placements for unit labels.
Q_DECL_DEPRECATED void setFontColor(const QColor &color)
Sets the color used for drawing text in the scalebar.
void setNumberOfSubdivisions(int subdivisions)
Sets the number of subdivisions for segments included in the right part of the scalebar (only used fo...
QgsTextFormat textFormat() const
Returns the text format used for drawing text in the scalebar.
void setTextFormat(const QgsTextFormat &format)
Sets the text format used for drawing text in the scalebar.
double minimumBarWidth() const
Returns the minimum width (in millimeters) for scale bar segments.
QString unitLabel() const
Returns the label for units.
int numberOfSubdivisions() const
Returns the number of subdivisions for segments included in the right part of the scalebar (only used...
Qgis::ScaleBarDistanceLabelHorizontalPlacement labelHorizontalPlacement() const
Returns the horizontal placement of text labels.
Q_DECL_DEPRECATED QFont font() const
Returns the font used for drawing text in the scalebar.
Qgis::DistanceUnit units() const
Returns the distance units used by the scalebar.
void setLabelBarSpace(double space)
Sets the spacing (in millimeters) between labels and the scalebar.
void setAlignment(Qgis::ScaleBarAlignment alignment)
Sets the scalebar alignment.
void setNumberOfSegments(int segments)
Sets the number of segments included in the scalebar.
void setUnitsPerSegment(double units)
Sets the number of scalebar units per segment.
void setSubdivisionsHeight(double height)
Sets the scalebar subdivisions height (in millimeters) for segments included in the right part of the...
double labelBarSpace() const
Returns the spacing (in millimeters) between labels and the scalebar.
QgsScaleBarSettings & operator=(const QgsScaleBarSettings &other)
double height() const
Returns the scalebar height (in millimeters).
int numberOfSegmentsLeft() const
Returns the number of segments included in the left part of the scalebar.
Q_DECL_DEPRECATED void setFont(const QFont &font)
Sets the font used for drawing text in the scalebar.
void setNumberOfSegmentsLeft(int segments)
Sets the number of segments included in the left part of the scalebar.
void setMapUnitsPerScaleBarUnit(double units)
Sets the number of map units per scale bar unit used by the scalebar.
void setUnits(Qgis::DistanceUnit units)
Sets the distance units used by the scalebar.
double mapUnitsPerScaleBarUnit() const
Returns the number of map units per scale bar unit used by the scalebar.
void setMinimumBarWidth(double width)
Sets the minimum width (in millimeters) for scale bar segments.
void setMaximumBarWidth(double width)
Sets the maximum width (in millimeters) for scale bar segments.
Container for all settings relating to text rendering.