QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
17 #ifndef QGSSCALEBARSETTINGS_H
18 #define QGSSCALEBARSETTINGS_H
20 #include "qgis_core.h"
60 SegmentSizeFitWidth = 1
68 LabelAboveSegment = 0,
77 LabelCenteredEdge = 0,
298 mTextFormat.setFont( font );
299 if ( font.pointSizeF() > 0 )
301 mTextFormat.setSize( font.pointSizeF() );
304 else if ( font.pixelSize() > 0 )
306 mTextFormat.setSize( font.pixelSize() );
341 Q_DECL_DEPRECATED
void setFillColor( const QColor &color )
SIP_DEPRECATED;
357 Q_DECL_DEPRECATED
void setFillColor2( const QColor &color )
SIP_DEPRECATED;
371 Q_DECL_DEPRECATED
void setLineColor( const QColor &color )
SIP_DEPRECATED;
385 Q_DECL_DEPRECATED
void setLineWidth(
double width )
SIP_DEPRECATED;
528 Q_DECL_DEPRECATED
void setBrush( const QBrush &brush )
SIP_DEPRECATED;
544 Q_DECL_DEPRECATED
void setBrush2( const QBrush &brush )
SIP_DEPRECATED;
550 double height()
const {
return mHeight; }
627 Q_DECL_DEPRECATED Qt::PenJoinStyle lineJoinStyle() const
SIP_DEPRECATED;
634 Q_DECL_DEPRECATED
void setLineJoinStyle( Qt::PenJoinStyle style )
SIP_DEPRECATED;
641 Q_DECL_DEPRECATED Qt::PenCapStyle lineCapStyle() const
SIP_DEPRECATED;
648 Q_DECL_DEPRECATED
void setLineCapStyle( Qt::PenCapStyle style )
SIP_DEPRECATED;
671 int mNumSegments = 2;
673 int mNumSegmentsLeft = 0;
675 int mNumSubdivisions = 1;
677 double mSubdivisionsHeight = 1.5;
679 double mNumUnitsPerSegment = 0;
681 double mNumMapUnitsPerScaleBarUnit = 1.0;
683 SegmentSizeMode mSegmentSizeMode = SegmentSizeFixed;
685 double mMinBarWidth = 50.0;
687 double mMaxBarWidth = 150.0;
690 QString mUnitLabeling;
696 double mHeight = 3.0;
705 double mLabelBarSpace = 3.0;
707 LabelVerticalPlacement mLabelVerticalPlacement = LabelAboveSegment;
709 LabelHorizontalPlacement mLabelHorizontalPlacement = LabelCenteredEdge;
712 double mBoxContentSpace = 1.0;
714 Alignment mAlignment = AlignLeft;
723 #endif // QGSSCALEBARSETTINGS_H
SegmentSizeMode
Modes for setting size for scale bar segments.
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.
double mapUnitsPerScaleBarUnit() const
Returns the number of map units per scale bar unit used by the scalebar.
void setAlignment(Alignment alignment)
Sets the scalebar alignment.
void setUnitsPerSegment(double units)
Sets the number of scalebar units per segment.
@ RenderPoints
Points (e.g., for font sizes)
void setLabelHorizontalPlacement(LabelHorizontalPlacement placement)
Sets the horizontal placement of text labels.
LabelHorizontalPlacement
Label horizontal placement.
@ AlignMiddle
Center aligned.
QgsTextFormat textFormat() const
Returns the text format used for drawing text in the scalebar.
@ LabelBelowSegment
Labels are drawn below the scalebar.
DistanceUnit
Units of distance.
void setMaximumBarWidth(double width)
Sets the maximum width (in millimeters) for scale bar segments.
void setNumberOfSubdivisions(int subdivisions)
Sets the number of subdivisions for segments included in the right part of the scalebar (only used fo...
SegmentSizeMode segmentSizeMode() const
Returns the size mode for the scale bar segments.
void setUnits(QgsUnitTypes::DistanceUnit units)
Sets the distance units used by the scalebar.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
double subdivisionsHeight() const
Returns the scalebar subdivisions height (in millimeters) for segments included in the right part of ...
Q_DECL_DEPRECATED void setFont(const QFont &font)
Sets the font used for drawing text in the scalebar.
double labelBarSpace() const
Returns the spacing (in millimeters) between labels and the scalebar.
Container for all settings relating to text rendering.
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).
Alignment
Scalebar alignment.
int numberOfSegments() const
Returns the number of segments included in the scalebar.
void setUnitLabel(const QString &label)
Sets the label for units.
void setTextFormat(const QgsTextFormat &format)
Sets the text format used for drawing text in the scalebar.
LabelVerticalPlacement labelVerticalPlacement() const
Returns the vertical placement of text labels.
QgsTextFormat & textFormat()
Returns the text format used for drawing text in the scalebar.
The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with Qgs...
A line symbol type, for rendering LineString and MultiLineString geometries.
Helper functions for various unit types.
QgsUnitTypes::DistanceUnit units() const
Returns the distance units used by the scalebar.
int numberOfSegmentsLeft() const
Returns the number of segments included in the left part of the scalebar.
@ AlignRight
Right aligned.
void setMapUnitsPerScaleBarUnit(double units)
Sets 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.
void setLabelVerticalPlacement(LabelVerticalPlacement placement)
Sets the vertical placement of text labels.
void setSubdivisionsHeight(double height)
Sets the scalebar subdivisions height (in millimeters) for segments included in the right part of the...
void setMinimumBarWidth(double width)
Sets the minimum width (in millimeters) for scale bar segments.
int numberOfSubdivisions() const
Returns the number of subdivisions for segments included in the right part of the scalebar (only used...
void setBoxContentSpace(double space)
Sets the space (margin) between the scalebar box and content in millimeters.
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.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
@ LabelCenteredSegment
Labels are drawn centered relative to segment.
Q_DECL_DEPRECATED void setFontColor(const QColor &color)
Sets the color used for drawing text in the scalebar.
Q_DECL_DEPRECATED QFont font() const
Returns the font used for drawing text in the scalebar.
LabelHorizontalPlacement labelHorizontalPlacement() const
Returns the horizontal placement of text labels.
QString unitLabel() const
Returns the label for units.
void setNumberOfSegmentsLeft(int segments)
Sets the number of segments included in the left part of the scalebar.
double minimumBarWidth() const
Returns the minimum width (in millimeters) for scale bar segments.
void setSegmentSizeMode(SegmentSizeMode mode)
Sets the size mode for scale bar segments.
LabelVerticalPlacement
Label vertical placement.