QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
16 #ifndef QGSLAYOUTITEMSCALEBAR_H
17 #define QGSLAYOUTITEMSCALEBAR_H
19 #include "qgis_core.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();
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;
727 #endif //QGSLAYOUTITEMSCALEBAR_H
SegmentSizeMode
Modes for setting size for scale bar segments.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QString unitLabel() const
Returns the label for units.
double mapUnitsPerScaleBarUnit() const
Returns the number of map units per scale bar unit used by the scalebar.
The class is used as a container of context for various read/write operations on other objects.
QgsScaleBarSettings::LabelVerticalPlacement labelVerticalPlacement() const
Returns the vertical placement of text labels.
virtual QIcon icon() const
Returns the item's icon.
int numberOfSegmentsLeft() const
Returns the number of segments included in the left part of the scalebar.
Contains settings and helpers relating to a render of a QgsLayoutItem.
QgsUnitTypes::DistanceUnit units() const
Returns the distance units used by the scalebar.
An interface for classes which can visit style entity (e.g. symbol) nodes (using the visitor pattern)...
QgsScaleBarSettings::Alignment alignment() const
Returns the scalebar alignment.
LabelHorizontalPlacement
Label horizontal placement.
DistanceUnit
Units of distance.
void setHeight(double height)
Sets the scalebar height (in millimeters).
void setLabelBarSpace(double space)
Sets the spacing (in millimeters) between labels and the scalebar.
virtual QgsLayoutSize minimumSize() const
Returns the minimum allowed size of the item, if applicable, or an empty size if item can be freely r...
int type() const override
Returns a unique graphics item type identifier.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Container for all settings relating to text rendering.
double unitsPerSegment() const
Returns the number of scalebar units per segment.
int numberOfSegments() const
Returns the number of segments included in the scalebar.
Alignment
Scalebar alignment.
QgsCompositionConverter class converts a QGIS 2.x composition to a QGIS 3.x layout.
void setSubdivisionsHeight(double height)
Sets the scalebar subdivisions height (in millimeters) for segments included in the right part of the...
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.
Abstract base class for scale bar renderers.
int numberOfSubdivisions() const
Returns the number of subdivisions for segments included in the right part of the scalebar (only used...
Base class for graphical items within a QgsLayout.
void setMapUnitsPerScaleBarUnit(double units)
Sets the number of map units per scale bar unit used by the scalebar.
Layout graphical items for displaying a map.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
void setNumberOfSubdivisions(int subdivisions)
Sets the number of subdivisions for segments included in the right part of the scalebar (only used fo...
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
QgsLayoutItemMap * linkedMap() const
Returns the map item linked to the scalebar.
double minimumBarWidth() const
Returns the minimum width (in millimeters) for scale bar segments.
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
double maximumBarWidth() const
Returns the maximum width (in millimeters) for scale bar segments.
double labelBarSpace() const
Returns the spacing (in millimeters) between labels and the scalebar.
double subdivisionsHeight() const
Returns the scalebar subdivisions height (in millimeters) for segments included in the right part of ...
A layout item subclass for scale bars.
QgsScaleBarSettings::SegmentSizeMode segmentSizeMode() const
Returns the size mode for the scale bar segments.
QgsScaleBarSettings::LabelHorizontalPlacement labelHorizontalPlacement() const
Returns the horizontal placement of text labels.
double boxContentSpace() const
Returns the spacing (margin) between the scalebar box and content in millimeters.
A base class for objects which belong to a layout.
void setUnitLabel(const QString &label)
Sets the label for units.
LabelVerticalPlacement
Label vertical placement.