Skip to content

Commit

Permalink
Move QgsPalLayerSettings default values to header
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 3, 2019
1 parent 964681f commit b235d31
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 108 deletions.
1 change: 1 addition & 0 deletions python/core/auto_generated/qgspallabeling.sip.in
Expand Up @@ -392,6 +392,7 @@ Returns the QgsExpression for this label settings. May be ``None`` if isExpressi


Placement placement;

unsigned int placementFlags;

bool centroidWhole;
Expand Down
63 changes: 2 additions & 61 deletions src/core/qgspallabeling.cpp
Expand Up @@ -256,69 +256,10 @@ void QgsPalLayerSettings::initPropertyDefinitions()

Q_NOWARN_DEPRECATED_PUSH // because of deprecated members
QgsPalLayerSettings::QgsPalLayerSettings()
: predefinedPositionOrder( *DEFAULT_PLACEMENT_ORDER() )
, mCallout( QgsApplication::calloutRegistry()->defaultCallout() )
{
initPropertyDefinitions();

drawLabels = true;
isExpression = false;
fieldIndex = 0;

useSubstitutions = false;

// text formatting
multilineAlign = MultiFollowPlacement;
addDirectionSymbol = false;
leftDirectionSymbol = QStringLiteral( "<" );
rightDirectionSymbol = QStringLiteral( ">" );
reverseDirectionSymbol = false;
placeDirectionSymbol = SymbolLeftRight;
formatNumbers = false;
decimals = 3;
plusSign = false;

// placement
placement = AroundPoint;
placementFlags = AboveLine | MapOrientation;
centroidWhole = false;
centroidInside = false;
predefinedPositionOrder = *DEFAULT_PLACEMENT_ORDER();
fitInPolygonOnly = false;
quadOffset = QuadrantOver;
xOffset = 0;
yOffset = 0;
offsetUnits = QgsUnitTypes::RenderMillimeters;
dist = 0;
distUnits = QgsUnitTypes::RenderMillimeters;
offsetType = FromPoint;
angleOffset = 0;
preserveRotation = true;
maxCurvedCharAngleIn = 25.0;
maxCurvedCharAngleOut = -25.0;
priority = 5;
repeatDistance = 0;
repeatDistanceUnit = QgsUnitTypes::RenderMillimeters;

// rendering
scaleVisibility = false;
maximumScale = 0.0;
minimumScale = 0.0;
fontLimitPixelSize = false;
fontMinPixelSize = 0; //trigger to turn it on by default for map unit labels
fontMaxPixelSize = 10000;
displayAll = false;
upsidedownLabels = Upright;

labelPerPart = false;
mergeLines = false;
minFeatureSize = 0.0;
limitNumLabels = false;
maxNumLabels = 2000;
obstacle = true;
obstacleFactor = 1.0;
obstacleType = PolygonInterior;
zIndex = 0.0;

mCallout.reset( QgsApplication::calloutRegistry()->defaultCallout() );
}
Q_NOWARN_DEPRECATED_POP

Expand Down

0 comments on commit b235d31

Please sign in to comment.