17#ifndef QGSSCALEBARSETTINGS_H
18#define QGSSCALEBARSETTINGS_H
59 SegmentSizeFitWidth = 1
67 LabelAboveSegment = 0,
76 LabelCenteredEdge = 0,
297 mTextFormat.setFont( font );
298 if ( font.pointSizeF() > 0 )
300 mTextFormat.setSize( font.pointSizeF() );
301 mTextFormat.setSizeUnit( Qgis::RenderUnit::Points );
303 else if ( font.pixelSize() > 0 )
305 mTextFormat.setSize( font.pixelSize() );
306 mTextFormat.setSizeUnit( Qgis::RenderUnit::Pixels );
340 Q_DECL_DEPRECATED
void setFillColor( const QColor &color )
SIP_DEPRECATED;
356 Q_DECL_DEPRECATED
void setFillColor2( const QColor &color )
SIP_DEPRECATED;
370 Q_DECL_DEPRECATED
void setLineColor( const QColor &color )
SIP_DEPRECATED;
384 Q_DECL_DEPRECATED
void setLineWidth(
double width )
SIP_DEPRECATED;
527 Q_DECL_DEPRECATED
void setBrush( const QBrush &brush )
SIP_DEPRECATED;
543 Q_DECL_DEPRECATED
void setBrush2( const QBrush &brush )
SIP_DEPRECATED;
549 double height()
const {
return mHeight; }
626 Q_DECL_DEPRECATED Qt::PenJoinStyle lineJoinStyle() const
SIP_DEPRECATED;
633 Q_DECL_DEPRECATED
void setLineJoinStyle( Qt::PenJoinStyle style )
SIP_DEPRECATED;
640 Q_DECL_DEPRECATED Qt::PenCapStyle lineCapStyle() const
SIP_DEPRECATED;
647 Q_DECL_DEPRECATED
void setLineCapStyle( Qt::PenCapStyle style )
SIP_DEPRECATED;
670 int mNumSegments = 2;
672 int mNumSegmentsLeft = 0;
674 int mNumSubdivisions = 1;
676 double mSubdivisionsHeight = 1.5;
678 double mNumUnitsPerSegment = 0;
680 double mNumMapUnitsPerScaleBarUnit = 1.0;
682 SegmentSizeMode mSegmentSizeMode = SegmentSizeFixed;
684 double mMinBarWidth = 50.0;
686 double mMaxBarWidth = 150.0;
689 QString mUnitLabeling;
695 double mHeight = 3.0;
704 double mLabelBarSpace = 3.0;
706 LabelVerticalPlacement mLabelVerticalPlacement = LabelAboveSegment;
708 LabelHorizontalPlacement mLabelHorizontalPlacement = LabelCenteredEdge;
711 double mBoxContentSpace = 1.0;
713 Alignment mAlignment = AlignLeft;
715 Qgis::DistanceUnit mUnits =
Qgis::DistanceUnit::Meters;
The Qgis class provides global constants for use throughout the application.
DistanceUnit
Units of distance.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with Qgs...
double subdivisionsHeight() const
Returns the scalebar subdivisions height (in millimeters) for segments included in the right part of ...
void setAlignment(Alignment alignment)
Sets the scalebar alignment.
SegmentSizeMode segmentSizeMode() const
Returns the size mode for the scale bar segments.
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.
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 setLabelVerticalPlacement(LabelVerticalPlacement placement)
Sets the vertical placement of text labels.
void setUnitLabel(const QString &label)
Sets the label for units.
LabelHorizontalPlacement labelHorizontalPlacement() const
Returns the horizontal placement of text labels.
void setBoxContentSpace(double space)
Sets the space (margin) between the scalebar box and content in millimeters.
Alignment alignment() const
Returns the scalebar alignment.
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).
Q_DECL_DEPRECATED void setFontColor(const QColor &color)
Sets the color used for drawing text in the scalebar.
Alignment
Scalebar alignment.
@ AlignMiddle
Center aligned.
@ AlignRight
Right aligned.
void setNumberOfSubdivisions(int subdivisions)
Sets the number of subdivisions for segments included in the right part of the scalebar (only used fo...
LabelVerticalPlacement labelVerticalPlacement() const
Returns the vertical placement of text labels.
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...
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.
LabelHorizontalPlacement
Label horizontal placement.
@ LabelCenteredSegment
Labels are drawn centered relative to segment.
void setLabelBarSpace(double space)
Sets the spacing (in millimeters) between labels and the scalebar.
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.
LabelVerticalPlacement
Label vertical placement.
@ LabelBelowSegment
Labels are drawn below the scalebar.
void setLabelHorizontalPlacement(LabelHorizontalPlacement placement)
Sets the horizontal placement of text labels.
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.
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.
SegmentSizeMode
Modes for setting size for scale bar segments.
void setNumberOfSegmentsLeft(int segments)
Sets the number of segments included in the left part of the scalebar.
void setSegmentSizeMode(SegmentSizeMode mode)
Sets the size mode for scale bar segments.
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.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.