16#ifndef QGSLAYOUTITEMSCALEBAR_H
17#define QGSLAYOUTITEMSCALEBAR_H
45 int type()
const override;
46 QIcon
icon()
const override;
68 void setNumberOfSegments(
int segments );
82 void setNumberOfSegmentsLeft(
int segments );
130 void setUnitsPerSegment(
double units );
166 void setMinimumBarWidth(
double minWidth );
186 void setMaximumBarWidth(
double maxWidth );
204 QString
unitLabel()
const {
return mSettings.unitLabel(); }
210 void setUnitLabel(
const QString &label ) { mSettings.setUnitLabel( label );}
350 Q_DECL_DEPRECATED
void setFont( const QFont &font )
SIP_DEPRECATED;
366 Q_DECL_DEPRECATED
void setFontColor( const QColor &color )
SIP_DEPRECATED;
382 Q_DECL_DEPRECATED
void setFillColor( const QColor &color )
SIP_DEPRECATED;
398 Q_DECL_DEPRECATED
void setFillColor2( const QColor &color )
SIP_DEPRECATED;
412 Q_DECL_DEPRECATED
void setLineColor( const QColor &color )
SIP_DEPRECATED;
426 Q_DECL_DEPRECATED
void setLineWidth(
double width )
SIP_DEPRECATED;
457 double height()
const {
return mSettings.height(); }
463 void setHeight(
double height ) { mSettings.setHeight( height ); }
499 void setBoxContentSpace(
double space );
558 Q_DECL_DEPRECATED Qt::PenJoinStyle lineJoinStyle() const
SIP_DEPRECATED;
565 Q_DECL_DEPRECATED
void setLineJoinStyle( Qt::PenJoinStyle style )
SIP_DEPRECATED;
572 Q_DECL_DEPRECATED Qt::PenCapStyle lineCapStyle() const
SIP_DEPRECATED;
579 Q_DECL_DEPRECATED
void setLineCapStyle( Qt::PenCapStyle style )
SIP_DEPRECATED;
585 void applyDefaultSettings();
603 Qgis::DistanceUnit guessUnits() const;
609 void applyDefaultSize(
Qgis::DistanceUnit units =
Qgis::DistanceUnit::Meters );
614 void resizeToMinimumWidth();
625 void setStyle( const QString &name );
631 QString style() const;
657 Qgis::ScaleCalculationMethod method() const;
665 void setMethod(
Qgis::ScaleCalculationMethod method );
673 void finalizeRestoreFromXml() override;
675 ExportLayerBehavior exportLayerBehavior() const override;
680 bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const
QgsReadWriteContext &context ) const override;
681 bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const
QgsReadWriteContext &context ) override;
685 void disconnectCurrentMap();
694 Qgis::ScaleCalculationMethod mMethod =
Qgis::ScaleCalculationMethod::HorizontalAverage;
700 double mSegmentMillimeters = 0.0;
703 void refreshSegmentMillimeters();
706 double mapWidth() const;
The Qgis class provides global constants 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.
ScaleBarSegmentSizeMode
Modes for setting size for scale bar segments.
QgsCompositionConverter class converts a QGIS 2.x composition to a QGIS 3.x layout.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Layout graphical items for displaying a map.
Contains settings and helpers relating to a render of a QgsLayoutItem.
A layout item subclass for scale bars.
Qgis::ScaleBarSegmentSizeMode segmentSizeMode() const
Returns the size mode for the scale bar segments.
double boxContentSpace() const
Returns the spacing (margin) between the scalebar box and content in millimeters.
double subdivisionsHeight() const
Returns the scalebar subdivisions height (in millimeters) for segments included in the right part of ...
double unitsPerSegment() const
Returns the number of scalebar units per segment.
int numberOfSegmentsLeft() const
Returns the number of segments included in the left part of the scalebar.
void setLabelBarSpace(double space)
Sets the spacing (in millimeters) between labels and the scalebar.
double minimumBarWidth() const
Returns the minimum width (in millimeters) for scale bar segments.
double labelBarSpace() const
Returns the spacing (in millimeters) between labels and the scalebar.
void setMapUnitsPerScaleBarUnit(double units)
Sets the number of map units per scale bar unit used by the scalebar.
int numberOfSegments() const
Returns the number of segments included in the scalebar.
void setHeight(double height)
Sets the scalebar height (in millimeters).
void setSubdivisionsHeight(double height)
Sets the scalebar subdivisions height (in millimeters) for segments included in the right part of the...
QString unitLabel() const
Returns the label for units.
Qgis::DistanceUnit units() const
Returns the distance units used by the scalebar.
double maximumBarWidth() const
Returns the maximum width (in millimeters) for scale bar segments.
QgsLayoutItemMap * linkedMap() const
Returns the map item linked to the scalebar.
void setUnitLabel(const QString &label)
Sets the label for units.
Qgis::ScaleBarAlignment alignment() const
Returns the scalebar alignment.
Qgis::ScaleBarDistanceLabelHorizontalPlacement labelHorizontalPlacement() const
Returns the horizontal placement of text labels.
Qgis::ScaleBarDistanceLabelVerticalPlacement labelVerticalPlacement() const
Returns the vertical placement of text labels.
double mapUnitsPerScaleBarUnit() const
Returns the number of map units per scale bar unit used by the scalebar.
int numberOfSubdivisions() const
Returns the number of subdivisions for segments included in the right part of the scalebar (only used...
void setNumberOfSubdivisions(int subdivisions)
Sets the number of subdivisions for segments included in the right part of the scalebar (only used fo...
Base class for graphical items within a QgsLayout.
virtual QIcon icon() const
Returns the item's icon.
int type() const override
Returns a unique graphics item type identifier.
virtual QgsLayoutSize minimumSize() const
Returns the minimum allowed size of the item, if applicable, or an empty size if item can be freely r...
A base class for objects which belong to a layout.
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
A line symbol type, for rendering LineString and MultiLineString geometries.
The class is used as a container of context for various read/write operations on other objects.
Abstract base class for scale bar renderers.
The QgsScaleBarSettings class stores the appearance and layout settings for scalebar drawing with Qgs...
An interface for classes which can visit style entity (e.g.
Container for all settings relating to text rendering.