QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
labeling
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
16
#include "
qgslabelpointsettings.h
"
17
18
#include "
qgsexpressioncontext.h
"
19
#include "
qgspallabeling.h
"
20
#include "
qgspropertycollection.h
"
21
22
#include "moc_qgslabelpointsettings.cpp"
23
24
void
QgsLabelPointSettings::updateDataDefinedProperties
(
const
QgsPropertyCollection
&properties,
QgsExpressionContext
&context )
25
{
26
// TODO -- ideally quadrant and ordered positions would also be evaluated here,
27
// but they have been left in their original evaluation location for now to avoid
28
// any unforeseen unwanted side effects...
29
if
( properties.
isActive
(
QgsPalLayerSettings::Property::MaximumDistance
) )
30
{
31
context.
setOriginalValueVariable
( mMaximumDistance );
32
mMaximumDistance = properties.
valueAsDouble
(
QgsPalLayerSettings::Property::MaximumDistance
, context, mMaximumDistance );
33
}
34
}
QgsAbstractPropertyCollection::valueAsDouble
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.
Definition
qgspropertycollection.cpp:69
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:491
QgsExpressionContext::setOriginalValueVariable
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
Definition
qgsexpressioncontext.cpp:754
QgsLabelPointSettings::updateDataDefinedProperties
void updateDataDefinedProperties(const QgsPropertyCollection &properties, QgsExpressionContext &context)
Updates the point settings to respect any data defined properties set within the specified properties...
Definition
qgslabelpointsettings.cpp:24
QgsPalLayerSettings::Property::MaximumDistance
@ MaximumDistance
Maximum distance of label from feature.
Definition
qgspallabeling.h:198
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
Definition
qgspropertycollection.h:348
QgsPropertyCollection::isActive
bool isActive(int key) const final
Returns true if the collection contains an active property with the specified key.
Definition
qgspropertycollection.cpp:286
qgsexpressioncontext.h
qgslabelpointsettings.h
qgspallabeling.h
qgspropertycollection.h
Generated on
for QGIS API Documentation by
1.17.0