Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debugging setting to show label metrics when rendering labels #50802

Merged
merged 1 commit into from
Nov 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions python/core/auto_additions/qgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,49 @@
Qgis.TextRenderFormat.__doc__ = 'Options for rendering text.\n\n.. versionadded:: 3.22\n\n' + '* ``TextFormatAlwaysOutlines``: ' + Qgis.TextRenderFormat.AlwaysOutlines.__doc__ + '\n' + '* ``TextFormatAlwaysText``: ' + Qgis.TextRenderFormat.AlwaysText.__doc__
# --
Qgis.TextRenderFormat.baseClass = Qgis
QgsLabelingEngineSettings.Flag = Qgis.LabelingFlag
# monkey patching scoped based enum
QgsLabelingEngineSettings.UseAllLabels = Qgis.LabelingFlag.UseAllLabels
QgsLabelingEngineSettings.UseAllLabels.is_monkey_patched = True
QgsLabelingEngineSettings.UseAllLabels.__doc__ = "Whether to draw all labels even if there would be collisions"
QgsLabelingEngineSettings.UsePartialCandidates = Qgis.LabelingFlag.UsePartialCandidates
QgsLabelingEngineSettings.UsePartialCandidates.is_monkey_patched = True
QgsLabelingEngineSettings.UsePartialCandidates.__doc__ = "Whether to use also label candidates that are partially outside of the map view"
QgsLabelingEngineSettings.RenderOutlineLabels = Qgis.LabelingFlag.RenderOutlineLabels
QgsLabelingEngineSettings.RenderOutlineLabels.is_monkey_patched = True
QgsLabelingEngineSettings.RenderOutlineLabels.__doc__ = "Whether to render labels as text or outlines. Deprecated and of QGIS 3.4.3 - use defaultTextRenderFormat() instead."
QgsLabelingEngineSettings.DrawLabelRectOnly = Qgis.LabelingFlag.DrawLabelRectOnly
QgsLabelingEngineSettings.DrawLabelRectOnly.is_monkey_patched = True
QgsLabelingEngineSettings.DrawLabelRectOnly.__doc__ = "Whether to only draw the label rect and not the actual label text (used for unit tests)"
QgsLabelingEngineSettings.DrawCandidates = Qgis.LabelingFlag.DrawCandidates
QgsLabelingEngineSettings.DrawCandidates.is_monkey_patched = True
QgsLabelingEngineSettings.DrawCandidates.__doc__ = "Whether to draw rectangles of generated candidates (good for debugging)"
QgsLabelingEngineSettings.DrawUnplacedLabels = Qgis.LabelingFlag.DrawUnplacedLabels
QgsLabelingEngineSettings.DrawUnplacedLabels.is_monkey_patched = True
QgsLabelingEngineSettings.DrawUnplacedLabels.__doc__ = "Whether to render unplaced labels as an indicator/warning for users"
QgsLabelingEngineSettings.CollectUnplacedLabels = Qgis.LabelingFlag.CollectUnplacedLabels
QgsLabelingEngineSettings.CollectUnplacedLabels.is_monkey_patched = True
QgsLabelingEngineSettings.CollectUnplacedLabels.__doc__ = "Whether unplaced labels should be collected in the labeling results (regardless of whether they are being rendered). Since QGIS 3.20"
QgsLabelingEngineSettings.DrawLabelMetrics = Qgis.LabelingFlag.DrawLabelMetrics
QgsLabelingEngineSettings.DrawLabelMetrics.is_monkey_patched = True
QgsLabelingEngineSettings.DrawLabelMetrics.__doc__ = "Whether to render label metric guides (for debugging). Since QGIS 3.30"
Qgis.LabelingFlag.__doc__ = 'Various flags that affect drawing and placement of labels.\n\nPrior to QGIS 3.30 this was available as :py:class:`QgsLabelingEngineSettings`.Flag\n\n.. versionadded:: 3.30\n\n' + '* ``UseAllLabels``: ' + Qgis.LabelingFlag.UseAllLabels.__doc__ + '\n' + '* ``UsePartialCandidates``: ' + Qgis.LabelingFlag.UsePartialCandidates.__doc__ + '\n' + '* ``RenderOutlineLabels``: ' + Qgis.LabelingFlag.RenderOutlineLabels.__doc__ + '\n' + '* ``DrawLabelRectOnly``: ' + Qgis.LabelingFlag.DrawLabelRectOnly.__doc__ + '\n' + '* ``DrawCandidates``: ' + Qgis.LabelingFlag.DrawCandidates.__doc__ + '\n' + '* ``DrawUnplacedLabels``: ' + Qgis.LabelingFlag.DrawUnplacedLabels.__doc__ + '\n' + '* ``CollectUnplacedLabels``: ' + Qgis.LabelingFlag.CollectUnplacedLabels.__doc__ + '\n' + '* ``DrawLabelMetrics``: ' + Qgis.LabelingFlag.DrawLabelMetrics.__doc__
# --
Qgis.LabelingFlag.baseClass = Qgis
QgsLabelingEngineSettings.Flags = Qgis.LabelingFlags
Qgis.LabelingFlags.baseClass = Qgis
LabelingFlags = Qgis # dirty hack since SIP seems to introduce the flags in module
QgsLabelingEngineSettings.PlacementEngineVersion = Qgis.LabelPlacementEngineVersion
# monkey patching scoped based enum
QgsLabelingEngineSettings.PlacementEngineVersion1 = Qgis.LabelPlacementEngineVersion.Version1
QgsLabelingEngineSettings.PlacementEngineVersion1.is_monkey_patched = True
QgsLabelingEngineSettings.PlacementEngineVersion1.__doc__ = "Version 1, matches placement from QGIS <= 3.10.1"
QgsLabelingEngineSettings.PlacementEngineVersion2 = Qgis.LabelPlacementEngineVersion.Version2
QgsLabelingEngineSettings.PlacementEngineVersion2.is_monkey_patched = True
QgsLabelingEngineSettings.PlacementEngineVersion2.__doc__ = "Version 2 (default for new projects since QGIS 3.12)"
Qgis.LabelPlacementEngineVersion.__doc__ = 'Labeling placement engine version.\n\nPrior to QGIS 3.30 this was available as :py:class:`QgsLabelingEngineSettings`.PlacementEngineVersion\n\n.. versionadded:: 3.30\n\n' + '* ``PlacementEngineVersion1``: ' + Qgis.LabelPlacementEngineVersion.Version1.__doc__ + '\n' + '* ``PlacementEngineVersion2``: ' + Qgis.LabelPlacementEngineVersion.Version2.__doc__
# --
Qgis.LabelPlacementEngineVersion.baseClass = Qgis
QgsTextFormat.TextOrientation = Qgis.TextOrientation
# monkey patching scoped based enum
QgsTextFormat.HorizontalOrientation = Qgis.TextOrientation.Horizontal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ Stores global configuration for labeling engine
#include "qgslabelingenginesettings.h"
%End
public:
enum Flag
{
UseAllLabels,
UsePartialCandidates,
// TODO QGIS 4.0: remove
RenderOutlineLabels,
DrawLabelRectOnly,
DrawCandidates,
DrawUnplacedLabels,
CollectUnplacedLabels,
};
typedef QFlags<QgsLabelingEngineSettings::Flag> Flags;



enum Search
Expand All @@ -44,32 +31,26 @@ Stores global configuration for labeling engine
Falp
};

enum PlacementEngineVersion
{
PlacementEngineVersion1,
PlacementEngineVersion2,
};

QgsLabelingEngineSettings();

void clear();
%Docstring
Returns the configuration to the defaults
%End

void setFlags( Flags flags );
void setFlags( Qgis::LabelingFlags flags );
%Docstring
Sets flags of the labeling engine
%End
Flags flags() const;
Qgis::LabelingFlags flags() const;
%Docstring
Gets flags of the labeling engine
%End
bool testFlag( Flag f ) const;
bool testFlag( Qgis::LabelingFlag f ) const;
%Docstring
Test whether a particular flag is enabled
%End
void setFlag( Flag f, bool enabled = true );
void setFlag( Qgis::LabelingFlag f, bool enabled = true );
%Docstring
Sets whether a particual flag is enabled
%End
Expand Down Expand Up @@ -188,7 +169,7 @@ Sets the ``color`` to use when rendering unplaced labels.
.. versionadded:: 3.10
%End

PlacementEngineVersion placementVersion() const;
Qgis::LabelPlacementEngineVersion placementVersion() const;
%Docstring
Returns the placement engine version, which dictates how the label placement problem is solved.

Expand All @@ -197,7 +178,7 @@ Returns the placement engine version, which dictates how the label placement pro
.. versionadded:: 3.10.2
%End

void setPlacementVersion( PlacementEngineVersion version );
void setPlacementVersion( Qgis::LabelPlacementEngineVersion version );
%Docstring
Sets the placement engine ``version``, which dictates how the label placement problem is solved.

Expand All @@ -208,9 +189,6 @@ Sets the placement engine ``version``, which dictates how the label placement pr

};

QFlags<QgsLabelingEngineSettings::Flag> operator|(QgsLabelingEngineSettings::Flag f1, QFlags<QgsLabelingEngineSettings::Flag> f2);


/************************************************************************
* This file has been generated automatically from *
* *
Expand Down
24 changes: 24 additions & 0 deletions python/core/auto_generated/qgis.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,28 @@ The development version
AlwaysText,
};

enum class LabelingFlag
{
UseAllLabels,
UsePartialCandidates,
// TODO QGIS 4.0: remove
RenderOutlineLabels,
DrawLabelRectOnly,
DrawCandidates,
DrawUnplacedLabels,
CollectUnplacedLabels,
DrawLabelMetrics,
};

typedef QFlags<Qgis::LabelingFlag> LabelingFlags;


enum class LabelPlacementEngineVersion
{
Version1,
Version2,
};

enum class TextOrientation
{
Horizontal,
Expand Down Expand Up @@ -1511,6 +1533,8 @@ QFlags<Qgis::SelectionFlag> operator|(Qgis::SelectionFlag f1, QFlags<Qgis::Selec

QFlags<Qgis::RasterRendererFlag> operator|(Qgis::RasterRendererFlag f1, QFlags<Qgis::RasterRendererFlag> f2);

QFlags<Qgis::LabelingFlag> operator|(Qgis::LabelingFlag f1, QFlags<Qgis::LabelingFlag> f2);




Expand Down
4 changes: 2 additions & 2 deletions src/analysis/processing/qgsalgorithmextractlabels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,8 @@ bool QgsExtractLabelsAlgorithm::prepareAlgorithm( const QVariantMap &parameters,

bool includeUnplaced = parameterAsBoolean( parameters, QStringLiteral( "INCLUDE_UNPLACED" ), context );
mLabelSettings = context.project()->labelingEngineSettings();
mLabelSettings.setFlag( QgsLabelingEngineSettings::DrawUnplacedLabels, includeUnplaced );
mLabelSettings.setFlag( QgsLabelingEngineSettings::CollectUnplacedLabels, includeUnplaced );
mLabelSettings.setFlag( Qgis::LabelingFlag::DrawUnplacedLabels, includeUnplaced );
mLabelSettings.setFlag( Qgis::LabelingFlag::CollectUnplacedLabels, includeUnplaced );

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3040,13 +3040,13 @@ void QgisApp::createActions()
connect( mActionShowUnplacedLabels, &QAction::toggled, this, [ = ]( bool active )
{
QgsLabelingEngineSettings engineSettings = QgsProject::instance()->labelingEngineSettings();
engineSettings.setFlag( QgsLabelingEngineSettings::DrawUnplacedLabels, active );
engineSettings.setFlag( Qgis::LabelingFlag::DrawUnplacedLabels, active );
QgsProject::instance()->setLabelingEngineSettings( engineSettings );
refreshMapCanvas( true );
} );
connect( QgsProject::instance(), &QgsProject::labelingEngineSettingsChanged, this, [ = ]
{
whileBlocking( mActionShowUnplacedLabels )->setChecked( QgsProject::instance()->labelingEngineSettings().testFlag( QgsLabelingEngineSettings::DrawUnplacedLabels ) );
whileBlocking( mActionShowUnplacedLabels )->setChecked( QgsProject::instance()->labelingEngineSettings().testFlag( Qgis::LabelingFlag::DrawUnplacedLabels ) );
} );
connect( mActionPinLabels, &QAction::triggered, this, &QgisApp::pinLabels );
connect( mActionShowHideLabels, &QAction::triggered, this, &QgisApp::showHideLabels );
Expand Down
13 changes: 7 additions & 6 deletions src/core/labeling/qgslabelingengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void QgsLabelingEngine::registerLabels( QgsRenderContext &context )
mPal->setMaximumLineCandidatesPerMapUnit( settings.maximumLineCandidatesPerCm() / context.convertToMapUnits( 10, QgsUnitTypes::RenderMillimeters ) );
mPal->setMaximumPolygonCandidatesPerMapUnitSquared( settings.maximumPolygonCandidatesPerCmSquared() / std::pow( context.convertToMapUnits( 10, QgsUnitTypes::RenderMillimeters ), 2 ) );

mPal->setShowPartialLabels( settings.testFlag( QgsLabelingEngineSettings::UsePartialCandidates ) );
mPal->setShowPartialLabels( settings.testFlag( Qgis::LabelingFlag::UsePartialCandidates ) );
mPal->setPlacementVersion( settings.placementVersion() );

// for each provider: get labels and register them in PAL
Expand Down Expand Up @@ -318,7 +318,7 @@ void QgsLabelingEngine::solve( QgsRenderContext &context )
mapBoundaryGeom = mapBoundaryGeom.difference( region.geometry );
}

if ( settings.flags() & QgsLabelingEngineSettings::DrawCandidates )
if ( settings.flags() & Qgis::LabelingFlag::DrawCandidates )
{
// draw map boundary
QgsFeature f;
Expand Down Expand Up @@ -382,7 +382,7 @@ void QgsLabelingEngine::solve( QgsRenderContext &context )
// this is done before actual solution of the problem
// before number of candidates gets reduced
// TODO mCandidates.clear();
if ( settings.testFlag( QgsLabelingEngineSettings::DrawCandidates ) && mProblem )
if ( settings.testFlag( Qgis::LabelingFlag::DrawCandidates ) && mProblem )
{
painter->setBrush( Qt::NoBrush );
for ( int i = 0; i < static_cast< int >( mProblem->featureCount() ); i++ )
Expand All @@ -398,8 +398,9 @@ void QgsLabelingEngine::solve( QgsRenderContext &context )

// find the solution
mLabels = mPal->solveProblem( mProblem.get(), context,
settings.testFlag( QgsLabelingEngineSettings::UseAllLabels ),
settings.testFlag( QgsLabelingEngineSettings::DrawUnplacedLabels ) || settings.testFlag( QgsLabelingEngineSettings::CollectUnplacedLabels ) ? &mUnlabeled : nullptr );
settings.testFlag( Qgis::LabelingFlag::UseAllLabels ),
settings.testFlag( Qgis::LabelingFlag::DrawUnplacedLabels )
|| settings.testFlag( Qgis::LabelingFlag::CollectUnplacedLabels ) ? &mUnlabeled : nullptr );

// sort labels
std::sort( mLabels.begin(), mLabels.end(), QgsLabelSorter( mMapSettings ) );
Expand Down Expand Up @@ -490,7 +491,7 @@ void QgsLabelingEngine::drawLabels( QgsRenderContext &context, const QString &la
}

// draw unplaced labels. These are always rendered on top
if ( settings.testFlag( QgsLabelingEngineSettings::DrawUnplacedLabels ) || settings.testFlag( QgsLabelingEngineSettings::CollectUnplacedLabels ) )
if ( settings.testFlag( Qgis::LabelingFlag::DrawUnplacedLabels ) || settings.testFlag( Qgis::LabelingFlag::CollectUnplacedLabels ) )
{
for ( pal::LabelPosition *label : std::as_const( mUnlabeled ) )
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/labeling/qgslabelingengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
#include "qgis_core.h"
#include "qgsmapsettings.h"

#include "qgslabelingenginesettings.h"
#include "qgslabeling.h"
#include "qgsfeedback.h"
#include "qgslabelobstaclesettings.h"

class QgsLabelingEngine;
class QgsLabelingResults;
class QgsLabelFeature;
class QgsLabelingEngineSettings;

namespace pal
{
Expand Down Expand Up @@ -86,7 +86,7 @@ class CORE_EXPORT QgsAbstractLabelProvider
*
* The default behavior is to draw nothing for these labels.
*
* \note This method is only used if the QgsLabelingEngineSettings::DrawUnplacedLabels flag
* \note This method is only used if the Qgis::Qgis::LabelingFlag::DrawUnplacedLabels flag
* is set on the labeling engine.
*
* \since QGIS 3.10
Expand Down
33 changes: 17 additions & 16 deletions src/core/labeling/qgslabelingenginesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "qgssymbollayerutils.h"

QgsLabelingEngineSettings::QgsLabelingEngineSettings()
: mFlags( UsePartialCandidates )
{
}

Expand All @@ -35,12 +34,13 @@ void QgsLabelingEngineSettings::readSettingsFromProject( QgsProject *prj )
mMaxLineCandidatesPerCm = prj->readDoubleEntry( QStringLiteral( "PAL" ), QStringLiteral( "/CandidatesLinePerCM" ), 5, &saved );
mMaxPolygonCandidatesPerCmSquared = prj->readDoubleEntry( QStringLiteral( "PAL" ), QStringLiteral( "/CandidatesPolygonPerCM" ), 2.5, &saved );

mFlags = Flags();
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingCandidates" ), false, &saved ) ) mFlags |= DrawCandidates;
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawRectOnly" ), false, &saved ) ) mFlags |= DrawLabelRectOnly;
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingAllLabels" ), false, &saved ) ) mFlags |= UseAllLabels;
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingPartialsLabels" ), true, &saved ) ) mFlags |= UsePartialCandidates;
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawUnplaced" ), false, &saved ) ) mFlags |= DrawUnplacedLabels;
mFlags = Qgis::LabelingFlags();
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingCandidates" ), false, &saved ) ) mFlags |= Qgis::LabelingFlag::DrawCandidates;
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawRectOnly" ), false, &saved ) ) mFlags |= Qgis::LabelingFlag::DrawLabelRectOnly;
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingAllLabels" ), false, &saved ) ) mFlags |= Qgis::LabelingFlag::UseAllLabels;
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingPartialsLabels" ), true, &saved ) ) mFlags |= Qgis::LabelingFlag::UsePartialCandidates;
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawUnplaced" ), false, &saved ) ) mFlags |= Qgis::LabelingFlag::DrawUnplacedLabels;
if ( prj->readBoolEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawLabelMetrics" ), false, &saved ) ) mFlags |= Qgis::LabelingFlag::DrawLabelMetrics;

mDefaultTextRenderFormat = Qgis::TextRenderFormat::AlwaysOutlines;
// if users have disabled the older PAL "DrawOutlineLabels" setting, respect that
Expand All @@ -53,7 +53,7 @@ void QgsLabelingEngineSettings::readSettingsFromProject( QgsProject *prj )

mUnplacedLabelColor = QgsSymbolLayerUtils::decodeColor( prj->readEntry( QStringLiteral( "PAL" ), QStringLiteral( "/UnplacedColor" ), QStringLiteral( "#ff0000" ) ) );

mPlacementVersion = static_cast< PlacementEngineVersion >( prj->readNumEntry( QStringLiteral( "PAL" ), QStringLiteral( "/PlacementEngineVersion" ), static_cast< int >( PlacementEngineVersion1 ) ) );
mPlacementVersion = static_cast< Qgis::LabelPlacementEngineVersion >( prj->readNumEntry( QStringLiteral( "PAL" ), QStringLiteral( "/PlacementEngineVersion" ), static_cast< int >( Qgis::LabelPlacementEngineVersion::Version1 ) ) );
}

void QgsLabelingEngineSettings::writeSettingsToProject( QgsProject *project )
Expand All @@ -62,17 +62,18 @@ void QgsLabelingEngineSettings::writeSettingsToProject( QgsProject *project )
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/CandidatesLinePerCM" ), mMaxLineCandidatesPerCm );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/CandidatesPolygonPerCM" ), mMaxPolygonCandidatesPerCmSquared );

project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingCandidates" ), mFlags.testFlag( DrawCandidates ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawRectOnly" ), mFlags.testFlag( DrawLabelRectOnly ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawUnplaced" ), mFlags.testFlag( DrawUnplacedLabels ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingAllLabels" ), mFlags.testFlag( UseAllLabels ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingPartialsLabels" ), mFlags.testFlag( UsePartialCandidates ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingCandidates" ), mFlags.testFlag( Qgis::LabelingFlag::DrawCandidates ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawRectOnly" ), mFlags.testFlag( Qgis::LabelingFlag::DrawLabelRectOnly ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawUnplaced" ), mFlags.testFlag( Qgis::LabelingFlag::DrawUnplacedLabels ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingAllLabels" ), mFlags.testFlag( Qgis::LabelingFlag::UseAllLabels ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/ShowingPartialsLabels" ), mFlags.testFlag( Qgis::LabelingFlag::UsePartialCandidates ) );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/DrawLabelMetrics" ), mFlags.testFlag( Qgis::LabelingFlag::DrawLabelMetrics ) );

project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/TextFormat" ), static_cast< int >( mDefaultTextRenderFormat ) );

project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/UnplacedColor" ), QgsSymbolLayerUtils::encodeColor( mUnplacedLabelColor ) );

project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/PlacementEngineVersion" ), mPlacementVersion );
project->writeEntry( QStringLiteral( "PAL" ), QStringLiteral( "/PlacementEngineVersion" ), static_cast< int >( mPlacementVersion ) );
}

QColor QgsLabelingEngineSettings::unplacedLabelColor() const
Expand All @@ -85,12 +86,12 @@ void QgsLabelingEngineSettings::setUnplacedLabelColor( const QColor &unplacedLab
mUnplacedLabelColor = unplacedLabelColor;
}

QgsLabelingEngineSettings::PlacementEngineVersion QgsLabelingEngineSettings::placementVersion() const
Qgis::LabelPlacementEngineVersion QgsLabelingEngineSettings::placementVersion() const
{
return mPlacementVersion;
}

void QgsLabelingEngineSettings::setPlacementVersion( PlacementEngineVersion placementVersion )
void QgsLabelingEngineSettings::setPlacementVersion( Qgis::LabelPlacementEngineVersion placementVersion )
{
mPlacementVersion = placementVersion;
}
Expand Down
Loading