QGIS API Documentation 3.99.0-Master (e9821da5c6b)
Loading...
Searching...
No Matches
qgslabelplacementsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslabelplacementsettings.h
3 --------------------------
4 Date : May 2022
5 Copyright : (C) 2022 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 QGSLABELPLACEMENTSETTINGS_H
17#define QGSLABELPLACEMENTSETTINGS_H
18
19#include "qgis.h"
20#include "qgis_core.h"
21#include "qgis_sip.h"
22
25
35{
36 public:
37
42 Qgis::LabelOverlapHandling overlapHandling() const { return mOverlapHandling; }
43
48 void setOverlapHandling( Qgis::LabelOverlapHandling handling ) { mOverlapHandling = handling; }
49
59 bool allowDegradedPlacement() const { return mAllowDegradedPlacement; }
60
70 void setAllowDegradedPlacement( bool allow ) { mAllowDegradedPlacement = allow; }
71
79 Qgis::LabelPrioritization prioritization() const { return mPrioritization; }
80
89
97 Qgis::MultiPartLabelingBehavior multiPartBehavior() const { return mMultiPartBehavior; }
98
106 void setMultiPartBehavior( Qgis::MultiPartLabelingBehavior behavior ) { mMultiPartBehavior = behavior; }
107
115 Qgis::LabelWhitespaceCollisionHandling whitespaceCollisionHandling() const { return mWhitespaceCollisionHandling; }
116
124 void setWhitespaceCollisionHandling( Qgis::LabelWhitespaceCollisionHandling handling ) { mWhitespaceCollisionHandling = handling; }
125
130 void updateDataDefinedProperties( const QgsPropertyCollection &properties, QgsExpressionContext &context );
131
132 private:
133
136
137 bool mAllowDegradedPlacement = false;
138
141
142};
143
144#endif // QGSLABELPLACEMENTSETTINGS_H
MultiPartLabelingBehavior
Behavior modifier for labeling features with multi-part geometries.
Definition qgis.h:1283
@ LabelLargestPartOnly
Place a label only on the largest part from the geometry.
Definition qgis.h:1284
LabelPrioritization
Label prioritization.
Definition qgis.h:1211
@ PreferCloser
Prefer closer labels, falling back to alternate positions before larger distances.
Definition qgis.h:1212
LabelWhitespaceCollisionHandling
Label whitespace collision handling.
Definition qgis.h:1199
@ TreatWhitespaceAsCollision
Treat overlapping whitespace text in labels and whitespace overlapping obstacles as collisions.
Definition qgis.h:1200
LabelOverlapHandling
Label overlap handling.
Definition qgis.h:1186
@ PreventOverlap
Do not allow labels to overlap other labels.
Definition qgis.h:1187
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Contains general settings related to how labels are placed.
void setOverlapHandling(Qgis::LabelOverlapHandling handling)
Sets the technique used to handle overlapping labels.
Qgis::LabelOverlapHandling overlapHandling() const
Returns the technique used to handle overlapping labels.
void setMultiPartBehavior(Qgis::MultiPartLabelingBehavior behavior)
Sets the multipart labeling behavior.
void setPrioritization(Qgis::LabelPrioritization prioritization)
Sets the technique used to prioritize labels.
Qgis::MultiPartLabelingBehavior multiPartBehavior() const
Returns the multipart labeling behavior.
bool allowDegradedPlacement() const
Returns true if labels can be placed in inferior fallback positions if they cannot otherwise be place...
void setAllowDegradedPlacement(bool allow)
Sets whether labels can be placed in inferior fallback positions if they cannot otherwise be placed.
Qgis::LabelPrioritization prioritization() const
Returns the label prioritization technique.
Qgis::LabelWhitespaceCollisionHandling whitespaceCollisionHandling() const
Returns the whitespace collision handling.
void setWhitespaceCollisionHandling(Qgis::LabelWhitespaceCollisionHandling handling)
Sets the whitespace collision handling.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.