@@ -932,7 +932,7 @@ bool QgsLayoutItem::excludeFromExports() const
932
932
void QgsLayoutItem::setExcludeFromExports ( bool exclude )
933
933
{
934
934
mExcludeFromExports = exclude;
935
- refreshDataDefinedProperty ( QgsLayoutObject::ExcludeFromExports );
935
+ refreshDataDefinedProperty ( QgsLayoutObject::DataDefinedProperty:: ExcludeFromExports );
936
936
}
937
937
938
938
bool QgsLayoutItem::containsAdvancedEffects () const
@@ -1005,15 +1005,15 @@ QgsLayoutPoint QgsLayoutItem::applyDataDefinedPosition( const QgsLayoutPoint &po
1005
1005
}
1006
1006
1007
1007
const QgsExpressionContext context = createExpressionContext ();
1008
- const double evaluatedX = mDataDefinedProperties .valueAsDouble ( QgsLayoutObject::PositionX, context, position.x () );
1009
- const double evaluatedY = mDataDefinedProperties .valueAsDouble ( QgsLayoutObject::PositionY, context, position.y () );
1008
+ const double evaluatedX = mDataDefinedProperties .valueAsDouble ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: PositionX ) , context, position.x () );
1009
+ const double evaluatedY = mDataDefinedProperties .valueAsDouble ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: PositionY ) , context, position.y () );
1010
1010
return QgsLayoutPoint ( evaluatedX, evaluatedY, position.units () );
1011
1011
}
1012
1012
1013
1013
void QgsLayoutItem::applyDataDefinedOrientation ( double &width, double &height, const QgsExpressionContext &context )
1014
1014
{
1015
1015
bool ok = false ;
1016
- const QString orientationString = mDataDefinedProperties .valueAsString ( QgsLayoutObject::PaperOrientation, context, QString (), &ok );
1016
+ const QString orientationString = mDataDefinedProperties .valueAsString ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: PaperOrientation ) , context, QString (), &ok );
1017
1017
if ( ok && !orientationString.isEmpty () )
1018
1018
{
1019
1019
const QgsLayoutItemPage::Orientation orientation = QgsLayoutUtils::decodePaperOrientation ( orientationString, ok );
@@ -1048,17 +1048,17 @@ QgsLayoutSize QgsLayoutItem::applyDataDefinedSize( const QgsLayoutSize &size )
1048
1048
return size;
1049
1049
}
1050
1050
1051
- if ( !mDataDefinedProperties .isActive ( QgsLayoutObject::PresetPaperSize ) &&
1052
- !mDataDefinedProperties .isActive ( QgsLayoutObject::ItemWidth ) &&
1053
- !mDataDefinedProperties .isActive ( QgsLayoutObject::ItemHeight ) &&
1054
- !mDataDefinedProperties .isActive ( QgsLayoutObject::PaperOrientation ) )
1051
+ if ( !mDataDefinedProperties .isActive ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: PresetPaperSize ) ) &&
1052
+ !mDataDefinedProperties .isActive ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: ItemWidth ) ) &&
1053
+ !mDataDefinedProperties .isActive ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: ItemHeight ) ) &&
1054
+ !mDataDefinedProperties .isActive ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: PaperOrientation ) ) )
1055
1055
return size;
1056
1056
1057
1057
1058
1058
const QgsExpressionContext context = createExpressionContext ();
1059
1059
1060
1060
// lowest priority is page size
1061
- const QString pageSize = mDataDefinedProperties .valueAsString ( QgsLayoutObject::PresetPaperSize, context );
1061
+ const QString pageSize = mDataDefinedProperties .valueAsString ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: PresetPaperSize ) , context );
1062
1062
QgsPageSize matchedSize;
1063
1063
double evaluatedWidth = size.width ();
1064
1064
double evaluatedHeight = size.height ();
@@ -1070,8 +1070,8 @@ QgsLayoutSize QgsLayoutItem::applyDataDefinedSize( const QgsLayoutSize &size )
1070
1070
}
1071
1071
1072
1072
// highest priority is dd width/height
1073
- evaluatedWidth = mDataDefinedProperties .valueAsDouble ( QgsLayoutObject::ItemWidth, context, evaluatedWidth );
1074
- evaluatedHeight = mDataDefinedProperties .valueAsDouble ( QgsLayoutObject::ItemHeight, context, evaluatedHeight );
1073
+ evaluatedWidth = mDataDefinedProperties .valueAsDouble ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: ItemWidth ) , context, evaluatedWidth );
1074
+ evaluatedHeight = mDataDefinedProperties .valueAsDouble ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: ItemHeight ) , context, evaluatedHeight );
1075
1075
1076
1076
// which is finally overwritten by data defined orientation
1077
1077
applyDataDefinedOrientation ( evaluatedWidth, evaluatedHeight, context );
@@ -1105,7 +1105,7 @@ double QgsLayoutItem::applyDataDefinedRotation( const double rotation )
1105
1105
}
1106
1106
1107
1107
const QgsExpressionContext context = createExpressionContext ();
1108
- const double evaluatedRotation = mDataDefinedProperties .valueAsDouble ( QgsLayoutObject::ItemRotation, context, rotation );
1108
+ const double evaluatedRotation = mDataDefinedProperties .valueAsDouble ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: ItemRotation ) , context, rotation );
1109
1109
return evaluatedRotation;
1110
1110
}
1111
1111
@@ -1114,41 +1114,41 @@ void QgsLayoutItem::refreshDataDefinedProperty( const QgsLayoutObject::DataDefin
1114
1114
// update data defined properties and update item to match
1115
1115
1116
1116
// evaluate width and height first, since they may affect position if non-top-left reference point set
1117
- if ( property == QgsLayoutObject::ItemWidth || property == QgsLayoutObject::ItemHeight ||
1118
- property == QgsLayoutObject::AllProperties )
1117
+ if ( property == QgsLayoutObject::DataDefinedProperty:: ItemWidth || property == QgsLayoutObject::DataDefinedProperty ::ItemHeight ||
1118
+ property == QgsLayoutObject::DataDefinedProperty:: AllProperties )
1119
1119
{
1120
1120
refreshItemSize ();
1121
1121
}
1122
- if ( property == QgsLayoutObject::PositionX || property == QgsLayoutObject::PositionY ||
1123
- property == QgsLayoutObject::AllProperties )
1122
+ if ( property == QgsLayoutObject::DataDefinedProperty:: PositionX || property == QgsLayoutObject::DataDefinedProperty ::PositionY ||
1123
+ property == QgsLayoutObject::DataDefinedProperty:: AllProperties )
1124
1124
{
1125
1125
refreshItemPosition ();
1126
1126
}
1127
- if ( property == QgsLayoutObject::ItemRotation || property == QgsLayoutObject::AllProperties )
1127
+ if ( property == QgsLayoutObject::DataDefinedProperty:: ItemRotation || property == QgsLayoutObject::DataDefinedProperty ::AllProperties )
1128
1128
{
1129
1129
refreshItemRotation ();
1130
1130
}
1131
- if ( property == QgsLayoutObject::Opacity || property == QgsLayoutObject::AllProperties )
1131
+ if ( property == QgsLayoutObject::DataDefinedProperty:: Opacity || property == QgsLayoutObject::DataDefinedProperty ::AllProperties )
1132
1132
{
1133
1133
refreshOpacity ( false );
1134
1134
}
1135
- if ( property == QgsLayoutObject::FrameColor || property == QgsLayoutObject::AllProperties )
1135
+ if ( property == QgsLayoutObject::DataDefinedProperty:: FrameColor || property == QgsLayoutObject::DataDefinedProperty ::AllProperties )
1136
1136
{
1137
1137
refreshFrame ( false );
1138
1138
}
1139
- if ( property == QgsLayoutObject::BackgroundColor || property == QgsLayoutObject::AllProperties )
1139
+ if ( property == QgsLayoutObject::DataDefinedProperty:: BackgroundColor || property == QgsLayoutObject::DataDefinedProperty ::AllProperties )
1140
1140
{
1141
1141
refreshBackgroundColor ( false );
1142
1142
}
1143
- if ( property == QgsLayoutObject::BlendMode || property == QgsLayoutObject::AllProperties )
1143
+ if ( property == QgsLayoutObject::DataDefinedProperty:: BlendMode || property == QgsLayoutObject::DataDefinedProperty ::AllProperties )
1144
1144
{
1145
1145
refreshBlendMode ();
1146
1146
}
1147
- if ( property == QgsLayoutObject::ExcludeFromExports || property == QgsLayoutObject::AllProperties )
1147
+ if ( property == QgsLayoutObject::DataDefinedProperty:: ExcludeFromExports || property == QgsLayoutObject::DataDefinedProperty ::AllProperties )
1148
1148
{
1149
1149
const bool exclude = mExcludeFromExports ;
1150
1150
// data defined exclude from exports set?
1151
- mEvaluatedExcludeFromExports = mDataDefinedProperties .valueAsBool ( QgsLayoutObject::ExcludeFromExports, createExpressionContext (), exclude );
1151
+ mEvaluatedExcludeFromExports = mDataDefinedProperties .valueAsBool ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: ExcludeFromExports ) , createExpressionContext (), exclude );
1152
1152
}
1153
1153
1154
1154
update ();
@@ -1446,7 +1446,7 @@ void QgsLayoutItem::refreshItemRotation( QPointF *origin )
1446
1446
double r = mItemRotation ;
1447
1447
1448
1448
// data defined rotation set?
1449
- r = mDataDefinedProperties .valueAsDouble ( QgsLayoutItem:: ItemRotation, createExpressionContext (), r );
1449
+ r = mDataDefinedProperties .valueAsDouble ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: ItemRotation ) , createExpressionContext (), r );
1450
1450
1451
1451
if ( qgsDoubleNear ( r, rotation () ) && !origin )
1452
1452
{
@@ -1483,7 +1483,7 @@ void QgsLayoutItem::refreshItemRotation( QPointF *origin )
1483
1483
void QgsLayoutItem::refreshOpacity ( bool updateItem )
1484
1484
{
1485
1485
// data defined opacity set?
1486
- const double opacity = mDataDefinedProperties .valueAsDouble ( QgsLayoutObject::Opacity, createExpressionContext (), mOpacity * 100.0 );
1486
+ const double opacity = mDataDefinedProperties .valueAsDouble ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: Opacity ) , createExpressionContext (), mOpacity * 100.0 );
1487
1487
1488
1488
// Set the QGraphicItem's opacity
1489
1489
mEvaluatedOpacity = opacity / 100.0 ;
@@ -1511,7 +1511,7 @@ void QgsLayoutItem::refreshFrame( bool updateItem )
1511
1511
1512
1512
// data defined stroke color set?
1513
1513
bool ok = false ;
1514
- const QColor frameColor = mDataDefinedProperties .valueAsColor ( QgsLayoutObject::FrameColor, createExpressionContext (), mFrameColor , &ok );
1514
+ const QColor frameColor = mDataDefinedProperties .valueAsColor ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: FrameColor ) , createExpressionContext (), mFrameColor , &ok );
1515
1515
QPen itemPen;
1516
1516
if ( ok )
1517
1517
{
@@ -1546,7 +1546,7 @@ void QgsLayoutItem::refreshBackgroundColor( bool updateItem )
1546
1546
{
1547
1547
// data defined fill color set?
1548
1548
bool ok = false ;
1549
- const QColor backgroundColor = mDataDefinedProperties .valueAsColor ( QgsLayoutObject::BackgroundColor, createExpressionContext (), mBackgroundColor , &ok );
1549
+ const QColor backgroundColor = mDataDefinedProperties .valueAsColor ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: BackgroundColor ) , createExpressionContext (), mBackgroundColor , &ok );
1550
1550
if ( ok )
1551
1551
{
1552
1552
setBrush ( QBrush ( backgroundColor, Qt::SolidPattern ) );
@@ -1567,7 +1567,7 @@ void QgsLayoutItem::refreshBlendMode()
1567
1567
1568
1568
// data defined blend mode set?
1569
1569
bool ok = false ;
1570
- const QString blendStr = mDataDefinedProperties .valueAsString ( QgsLayoutObject::BlendMode, createExpressionContext (), QString (), &ok );
1570
+ const QString blendStr = mDataDefinedProperties .valueAsString ( static_cast < int >( QgsLayoutObject::DataDefinedProperty:: BlendMode ) , createExpressionContext (), QString (), &ok );
1571
1571
if ( ok && !blendStr.isEmpty () )
1572
1572
{
1573
1573
const QString blendstr = blendStr.trimmed ();
0 commit comments