QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgslabelpointsettings.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelpointsettings.cpp
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
17#include "moc_qgslabelpointsettings.cpp"
20#include "qgspallabeling.h"
21
22
24{
25 // TODO -- ideally quadrant and ordered positions would also be evaluated here,
26 // but they have been left in their original evaluation location for now to avoid
27 // any unforeseen unwanted side effects...
29 {
30 context.setOriginalValueVariable( mMaximumDistance );
31 mMaximumDistance = properties.valueAsDouble( QgsPalLayerSettings::Property::MaximumDistance, context, mMaximumDistance );
32 }
33}
double valueAsDouble(int key, const QgsExpressionContext &context, double defaultValue=0.0, bool *ok=nullptr) const
Calculates the current value of the property with the specified key and interprets it as a double.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
void updateDataDefinedProperties(const QgsPropertyCollection &properties, QgsExpressionContext &context)
Updates the point settings to respect any data defined properties set within the specified properties...
@ MaximumDistance
Maximum distance of label from feature.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
bool isActive(int key) const final
Returns true if the collection contains an active property with the specified key.