QGIS API Documentation 3.43.0-Master (b60ef06885e)
qgslabelpointsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelpointsettings.h
3 --------------------------
4 Date : May 2024
5 Copyright : (C) 2024 by Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSLABELPOINTSETTINGS_H
17#define QGSLABELPOINTSETTINGS_H
18
19#include "qgis_core.h"
20#include "qgis_sip.h"
21#include "qgsmapunitscale.h"
22#include <QString>
23
26
39class CORE_EXPORT QgsLabelPointSettings
40{
41 Q_GADGET
42
43 public:
44
49 void updateDataDefinedProperties( const QgsPropertyCollection &properties, QgsExpressionContext &context );
50
56 Qgis::LabelQuadrantPosition quadrant() const { return mQuadrant; }
57
63 void setQuadrant( Qgis::LabelQuadrantPosition quadrant ) { mQuadrant = quadrant; }
64
73 QVector< Qgis::LabelPredefinedPointPosition > predefinedPositionOrder() const { return mPredefinedPositionOrder; }
74
83 void setPredefinedPositionOrder( const QVector< Qgis::LabelPredefinedPointPosition > &order ) { mPredefinedPositionOrder = order; }
84
98 double maximumDistance() const { return mMaximumDistance; }
99
113 void setMaximumDistance( double distance ) { mMaximumDistance = distance; }
114
122 Qgis::RenderUnit maximumDistanceUnit() const { return mMaximumDistanceUnit; }
123
131 void setMaximumDistanceUnit( Qgis::RenderUnit unit ) { mMaximumDistanceUnit = unit;}
132
140 QgsMapUnitScale maximumDistanceMapUnitScale() const { return mMaximumDistanceMapUnitScale; }
141
149 void setMaximumDistanceMapUnitScale( const QgsMapUnitScale &scale ) { mMaximumDistanceMapUnitScale = scale; }
150
151 private:
152
154
155 QVector< Qgis::LabelPredefinedPointPosition > mPredefinedPositionOrder;
156
157 double mMaximumDistance = 0;
158 Qgis::RenderUnit mMaximumDistanceUnit = Qgis::RenderUnit::Millimeters;
159 QgsMapUnitScale mMaximumDistanceMapUnitScale;
160
161};
162
163#endif // QGSLABELPOINTSETTINGS_H
LabelQuadrantPosition
Label quadrant positions.
Definition qgis.h:1219
RenderUnit
Rendering size units.
Definition qgis.h:5013
@ Millimeters
Millimeters.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Contains settings related to how the label engine places and formats labels for point-like features.
void setMaximumDistance(double distance)
Sets the maximum distance which labels are allowed to be from their corresponding points.
QgsMapUnitScale maximumDistanceMapUnitScale() const
Returns the map unit scale for label maximum distance.
void setMaximumDistanceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for label maximum distance.
double maximumDistance() const
Returns the maximum distance which labels are allowed to be from their corresponding points.
void setQuadrant(Qgis::LabelQuadrantPosition quadrant)
Sets the quadrant in which to offset labels from the point.
Qgis::LabelQuadrantPosition quadrant() const
Returns the quadrant in which to offset labels from the point.
Qgis::RenderUnit maximumDistanceUnit() const
Returns the units for label maximum distance.
void setMaximumDistanceUnit(Qgis::RenderUnit unit)
Sets the unit for label maximum distance.
QVector< Qgis::LabelPredefinedPointPosition > predefinedPositionOrder() const
Returns the ordered list of predefined label positions for points.
void setPredefinedPositionOrder(const QVector< Qgis::LabelPredefinedPointPosition > &order)
Sets the ordered list of predefined label positions for points.
Struct for storing maximum and minimum scales for measurements in map units.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.