16#ifndef QGSLAYOUTITEMSCALEBAR_H
17#define QGSLAYOUTITEMSCALEBAR_H
46 int type()
const override;
47 QIcon
icon()
const override;
69 void setNumberOfSegments(
int segments );
83 void setNumberOfSegmentsLeft(
int segments );
131 void setUnitsPerSegment(
double units );
167 void setMinimumBarWidth(
double minWidth );
187 void setMaximumBarWidth(
double maxWidth );
205 QString
unitLabel()
const {
return mSettings.unitLabel(); }
211 void setUnitLabel(
const QString &label ) { mSettings.setUnitLabel( label );}
351 Q_DECL_DEPRECATED
void setFont( const QFont &font )
SIP_DEPRECATED;
367 Q_DECL_DEPRECATED
void setFontColor( const QColor &color )
SIP_DEPRECATED;
383 Q_DECL_DEPRECATED
void setFillColor( const QColor &color )
SIP_DEPRECATED;
399 Q_DECL_DEPRECATED
void setFillColor2( const QColor &color )
SIP_DEPRECATED;
413 Q_DECL_DEPRECATED
void setLineColor( const QColor &color )
SIP_DEPRECATED;
427 Q_DECL_DEPRECATED
void setLineWidth(
double width )
SIP_DEPRECATED;
458 double height()
const {
return mSettings.height(); }
464 void setHeight(
double height ) { mSettings.setHeight( height ); }
500 void setBoxContentSpace(
double space );
559 Q_DECL_DEPRECATED Qt::PenJoinStyle lineJoinStyle() const
SIP_DEPRECATED;
566 Q_DECL_DEPRECATED
void setLineJoinStyle( Qt::PenJoinStyle style )
SIP_DEPRECATED;
573 Q_DECL_DEPRECATED Qt::PenCapStyle lineCapStyle() const
SIP_DEPRECATED;
580 Q_DECL_DEPRECATED
void setLineCapStyle( Qt::PenCapStyle style )
SIP_DEPRECATED;
586 void applyDefaultSettings();
604 Qgis::DistanceUnit guessUnits() const;
610 void applyDefaultSize(
Qgis::DistanceUnit units =
Qgis::DistanceUnit::Meters );
615 void resizeToMinimumWidth();
626 void setStyle( const QString &name );
632 QString style() const;
658 void finalizeRestoreFromXml() override;
660 ExportLayerBehavior exportLayerBehavior() const override;
665 bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const
QgsReadWriteContext &context ) const override;
666 bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const
QgsReadWriteContext &context ) override;
670 void disconnectCurrentMap();
684 double mSegmentMillimeters = 0.0;
687 void refreshSegmentMillimeters();
690 double mapWidth() const;
The Qgis class provides global constants for use throughout the application.
DistanceUnit
Units of distance.
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.
QgsScaleBarSettings::Alignment alignment() const
Returns the scalebar alignment.
QgsScaleBarSettings::SegmentSizeMode 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.
QgsScaleBarSettings::LabelHorizontalPlacement labelHorizontalPlacement() const
Returns the horizontal placement of text labels.
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.
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...
QgsScaleBarSettings::LabelVerticalPlacement labelVerticalPlacement() const
Returns the vertical placement of text labels.
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...
Alignment
Scalebar alignment.
LabelHorizontalPlacement
Label horizontal placement.
LabelVerticalPlacement
Label vertical placement.
SegmentSizeMode
Modes for setting size for scale bar segments.
An interface for classes which can visit style entity (e.g.
Container for all settings relating to text rendering.