QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
15 #ifndef QGSLABELINGENGINESETTINGS_H
16 #define QGSLABELINGENGINESETTINGS_H
18 #include "qgis_core.h"
36 UseAllLabels = 1 << 1,
37 UsePartialCandidates = 1 << 2,
39 RenderOutlineLabels = 1 << 3,
40 DrawLabelRectOnly = 1 << 4,
41 DrawCandidates = 1 << 5,
42 DrawUnplacedLabels = 1 << 6,
44 Q_DECLARE_FLAGS( Flags, Flag )
78 void setFlags( Flags flags ) { mFlags = flags; }
80 Flags
flags()
const {
return mFlags; }
84 void setFlag(
Flag f,
bool enabled =
true ) {
if ( enabled ) mFlags |= f;
else mFlags &= ~f; }
124 Q_UNUSED( candPoint )
126 Q_UNUSED( candPolygon )
135 Q_UNUSED( candPoint )
137 Q_UNUSED( candPolygon )
153 void readSettingsFromProject(
QgsProject *project );
155 void writeSettingsToProject(
QgsProject *project );
169 return mDefaultTextRenderFormat;
180 mDefaultTextRenderFormat = format;
189 QColor unplacedLabelColor()
const;
197 void setUnplacedLabelColor(
const QColor &color );
205 PlacementEngineVersion placementVersion()
const;
213 void setPlacementVersion( PlacementEngineVersion version );
219 Search mSearchMethod = Chain;
222 double mMaxLineCandidatesPerCm = 5;
223 double mMaxPolygonCandidatesPerCmSquared = 2.5;
225 QColor mUnplacedLabelColor = QColor( 255, 0, 0 );
227 PlacementEngineVersion mPlacementVersion = PlacementEngineVersion2;
235 #endif // QGSLABELINGENGINESETTINGS_H
Q_DECL_DEPRECATED void setNumCandidatePositions(int candPoint, int candLine, int candPolygon)
Sets the number of candidate positions that will be generated for each label feature.
Q_DECL_DEPRECATED Search searchMethod() const
Which search method to use for removal collisions between labels.
TextRenderFormat
Options for rendering text.
Flags flags() const
Gets flags of the labeling engine.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
PlacementEngineVersion
Placement engine version.
Stores global configuration for labeling engine.
bool testFlag(Flag f) const
Test whether a particular flag is enabled.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
void setFlags(Flags flags)
Sets flags of the labeling engine.
Flag
Various flags that affect drawing and placement of labels.
@ PlacementEngineVersion1
Version 1, matches placement from QGIS <= 3.10.1.
Q_DECL_DEPRECATED void numCandidatePositions(int &candPoint, int &candLine, int &candPolygon) const
Gets number of candidate positions that will be generated for each label feature.
Search
Search methods in the PAL library to remove colliding labels (methods have different processing speed...
QgsRenderContext::TextRenderFormat defaultTextRenderFormat() const
Returns the default text rendering format for the labels.
void setMaximumPolygonCandidatesPerCmSquared(double candidates)
Sets the maximum number of polygon label candidates per centimeter squared.
void setFlag(Flag f, bool enabled=true)
Sets whether a particual flag is enabled.
double maximumPolygonCandidatesPerCmSquared() const
Returns the maximum number of polygon label candidate positions per centimeter squared.
void setMaximumLineCandidatesPerCm(double candidates)
Sets the maximum number of line label candidates per centimeter.
void setDefaultTextRenderFormat(QgsRenderContext::TextRenderFormat format)
Sets the default text rendering format for the labels.
double maximumLineCandidatesPerCm() const
Returns the maximum number of line label candidate positions per centimeter.
@ PlacementEngineVersion2
Version 2 (default for new projects since QGIS 3.12)
@ TextFormatAlwaysOutlines
Always render text using path objects (AKA outlines/curves).
Q_DECL_DEPRECATED void setSearchMethod(Search s)
Used to set which search method to use for removal collisions between labels.