Skip to content

Commit a821e27

Browse files
committed
Also use enum for layout data defined properties
1 parent d8656dc commit a821e27

File tree

59 files changed

+767
-593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+767
-593
lines changed

python/PyQt6/core/auto_additions/qgslayoutobject.py

+175
Large diffs are not rendered by default.

python/PyQt6/core/auto_generated/layout/qgslayoutitem.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ Forces a deferred update of any cached image the item uses.
11031103
Triggers a redraw (update) of the item.
11041104
%End
11051105

1106-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
1106+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
11071107
%Docstring
11081108
Refreshes a data defined ``property`` for the item by reevaluating the property's value
11091109
and redrawing the item with this new value. If ``property`` is set to

python/PyQt6/core/auto_generated/layout/qgslayoutitemattributetable.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ Queries the attribute table's vector layer for attributes to show in the table.
310310
virtual void finalizeRestoreFromXml();
311311

312312

313-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
313+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
314314

315315

316316
bool useConditionalStyling() const;

python/PyQt6/core/auto_generated/layout/qgslayoutitemelevationprofile.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The caller takes responsibility for deleting the returned object.
4040

4141
virtual QIcon icon() const;
4242

43-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
43+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
4444

4545
virtual QgsLayoutItem::Flags itemFlags() const;
4646

python/PyQt6/core/auto_generated/layout/qgslayoutitemhtml.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Reloads the html source from the url and redraws the item.
256256
Recalculates the frame sizes for the current viewport dimensions
257257
%End
258258

259-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
259+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
260260

261261

262262
protected:

python/PyQt6/core/auto_generated/layout/qgslayoutitemlegend.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ Returns the legend's renderer settings object.
643643

644644
virtual void invalidateCache();
645645

646-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
646+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
647647

648648

649649
protected:

python/PyQt6/core/auto_generated/layout/qgslayoutitemmap.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ Emitted whenever the item's map preview has been refreshed.
10341034
Updates the bounding rect of this item. Call this function before doing any changes related to annotation out of the map rectangle
10351035
%End
10361036

1037-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
1037+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
10381038

10391039

10401040
};

python/PyQt6/core/auto_generated/layout/qgslayoutitempicture.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ and reloads and redraws the picture.
342342
Forces a recalculation of the picture's frame size
343343
%End
344344

345-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
345+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
346346

347347

348348
signals:

python/PyQt6/core/auto_generated/layout/qgslayoutitemscalebar.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ Ownership of ``format`` is transferred to the scalebar.
803803
Adjusts the scale bar box size and updates the item.
804804
%End
805805

806-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
806+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
807807

808808
virtual void finalizeRestoreFromXml();
809809

python/PyQt6/core/auto_generated/layout/qgslayoutmultiframe.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ method is useful for multiframes which implement a :py:func:`~QgsLayoutMultiFram
363363
.. seealso:: :py:func:`recalculateFrameSizes`
364364
%End
365365

366-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
366+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
367367
%Docstring
368368
Refreshes a data defined ``property`` for the multi frame by reevaluating the property's value
369369
and redrawing the item with this new value. If ``property`` is set to

python/PyQt6/core/auto_generated/layout/qgslayoutobject.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ A base class for objects which belong to a layout.
111111
%End
112112
public:
113113

114-
enum DataDefinedProperty
114+
enum class DataDefinedProperty /BaseType=IntFlag/
115115
{
116116
NoProperty,
117117
AllProperties,

python/core/auto_generated/layout/qgslayoutitem.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ Forces a deferred update of any cached image the item uses.
11031103
Triggers a redraw (update) of the item.
11041104
%End
11051105

1106-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
1106+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
11071107
%Docstring
11081108
Refreshes a data defined ``property`` for the item by reevaluating the property's value
11091109
and redrawing the item with this new value. If ``property`` is set to

python/core/auto_generated/layout/qgslayoutitemattributetable.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ Queries the attribute table's vector layer for attributes to show in the table.
310310
virtual void finalizeRestoreFromXml();
311311

312312

313-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
313+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
314314

315315

316316
bool useConditionalStyling() const;

python/core/auto_generated/layout/qgslayoutitemelevationprofile.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The caller takes responsibility for deleting the returned object.
4040

4141
virtual QIcon icon() const;
4242

43-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
43+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
4444

4545
virtual QgsLayoutItem::Flags itemFlags() const;
4646

python/core/auto_generated/layout/qgslayoutitemhtml.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Reloads the html source from the url and redraws the item.
256256
Recalculates the frame sizes for the current viewport dimensions
257257
%End
258258

259-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
259+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
260260

261261

262262
protected:

python/core/auto_generated/layout/qgslayoutitemlegend.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ Returns the legend's renderer settings object.
643643

644644
virtual void invalidateCache();
645645

646-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
646+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
647647

648648

649649
protected:

python/core/auto_generated/layout/qgslayoutitemmap.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ Emitted whenever the item's map preview has been refreshed.
10341034
Updates the bounding rect of this item. Call this function before doing any changes related to annotation out of the map rectangle
10351035
%End
10361036

1037-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
1037+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
10381038

10391039

10401040
};

python/core/auto_generated/layout/qgslayoutitempicture.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ and reloads and redraws the picture.
342342
Forces a recalculation of the picture's frame size
343343
%End
344344

345-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
345+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
346346

347347

348348
signals:

python/core/auto_generated/layout/qgslayoutitemscalebar.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ Ownership of ``format`` is transferred to the scalebar.
803803
Adjusts the scale bar box size and updates the item.
804804
%End
805805

806-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
806+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
807807

808808
virtual void finalizeRestoreFromXml();
809809

python/core/auto_generated/layout/qgslayoutmultiframe.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ method is useful for multiframes which implement a :py:func:`~QgsLayoutMultiFram
363363
.. seealso:: :py:func:`recalculateFrameSizes`
364364
%End
365365

366-
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::AllProperties );
366+
virtual void refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty property = QgsLayoutObject::DataDefinedProperty::AllProperties );
367367
%Docstring
368368
Refreshes a data defined ``property`` for the multi frame by reevaluating the property's value
369369
and redrawing the item with this new value. If ``property`` is set to

python/core/auto_generated/layout/qgslayoutobject.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ A base class for objects which belong to a layout.
111111
%End
112112
public:
113113

114-
enum DataDefinedProperty
114+
enum class DataDefinedProperty
115115
{
116116
NoProperty,
117117
AllProperties,

src/app/layout/qgslayoutdesignerdialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4547,7 +4547,7 @@ bool QgsLayoutDesignerDialog::getPdfExportSettings( QgsLayoutExporter::PdfExport
45474547
break;
45484548
}
45494549

4550-
if ( map->mapRotation() != 0 || map->itemRotation() != 0 || map->dataDefinedProperties().isActive( QgsLayoutObject::MapRotation ) )
4550+
if ( map->mapRotation() != 0 || map->itemRotation() != 0 || map->dataDefinedProperties().isActive( static_cast<int>( QgsLayoutObject::DataDefinedProperty::MapRotation ) ) )
45514551
{
45524552
allowGeoPdfExport = false;
45534553
dialogGeoPdfReason = tr( "One or more map items are rotated. This is not supported for GeoPDF export." );

src/core/layout/qgslayoutitem.cpp

+28-28
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ bool QgsLayoutItem::excludeFromExports() const
932932
void QgsLayoutItem::setExcludeFromExports( bool exclude )
933933
{
934934
mExcludeFromExports = exclude;
935-
refreshDataDefinedProperty( QgsLayoutObject::ExcludeFromExports );
935+
refreshDataDefinedProperty( QgsLayoutObject::DataDefinedProperty::ExcludeFromExports );
936936
}
937937

938938
bool QgsLayoutItem::containsAdvancedEffects() const
@@ -1005,15 +1005,15 @@ QgsLayoutPoint QgsLayoutItem::applyDataDefinedPosition( const QgsLayoutPoint &po
10051005
}
10061006

10071007
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() );
10101010
return QgsLayoutPoint( evaluatedX, evaluatedY, position.units() );
10111011
}
10121012

10131013
void QgsLayoutItem::applyDataDefinedOrientation( double &width, double &height, const QgsExpressionContext &context )
10141014
{
10151015
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 );
10171017
if ( ok && !orientationString.isEmpty() )
10181018
{
10191019
const QgsLayoutItemPage::Orientation orientation = QgsLayoutUtils::decodePaperOrientation( orientationString, ok );
@@ -1048,17 +1048,17 @@ QgsLayoutSize QgsLayoutItem::applyDataDefinedSize( const QgsLayoutSize &size )
10481048
return size;
10491049
}
10501050

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 ) ) )
10551055
return size;
10561056

10571057

10581058
const QgsExpressionContext context = createExpressionContext();
10591059

10601060
// 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 );
10621062
QgsPageSize matchedSize;
10631063
double evaluatedWidth = size.width();
10641064
double evaluatedHeight = size.height();
@@ -1070,8 +1070,8 @@ QgsLayoutSize QgsLayoutItem::applyDataDefinedSize( const QgsLayoutSize &size )
10701070
}
10711071

10721072
// 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 );
10751075

10761076
//which is finally overwritten by data defined orientation
10771077
applyDataDefinedOrientation( evaluatedWidth, evaluatedHeight, context );
@@ -1105,7 +1105,7 @@ double QgsLayoutItem::applyDataDefinedRotation( const double rotation )
11051105
}
11061106

11071107
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 );
11091109
return evaluatedRotation;
11101110
}
11111111

@@ -1114,41 +1114,41 @@ void QgsLayoutItem::refreshDataDefinedProperty( const QgsLayoutObject::DataDefin
11141114
//update data defined properties and update item to match
11151115

11161116
//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 )
11191119
{
11201120
refreshItemSize();
11211121
}
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 )
11241124
{
11251125
refreshItemPosition();
11261126
}
1127-
if ( property == QgsLayoutObject::ItemRotation || property == QgsLayoutObject::AllProperties )
1127+
if ( property == QgsLayoutObject::DataDefinedProperty::ItemRotation || property == QgsLayoutObject::DataDefinedProperty::AllProperties )
11281128
{
11291129
refreshItemRotation();
11301130
}
1131-
if ( property == QgsLayoutObject::Opacity || property == QgsLayoutObject::AllProperties )
1131+
if ( property == QgsLayoutObject::DataDefinedProperty::Opacity || property == QgsLayoutObject::DataDefinedProperty::AllProperties )
11321132
{
11331133
refreshOpacity( false );
11341134
}
1135-
if ( property == QgsLayoutObject::FrameColor || property == QgsLayoutObject::AllProperties )
1135+
if ( property == QgsLayoutObject::DataDefinedProperty::FrameColor || property == QgsLayoutObject::DataDefinedProperty::AllProperties )
11361136
{
11371137
refreshFrame( false );
11381138
}
1139-
if ( property == QgsLayoutObject::BackgroundColor || property == QgsLayoutObject::AllProperties )
1139+
if ( property == QgsLayoutObject::DataDefinedProperty::BackgroundColor || property == QgsLayoutObject::DataDefinedProperty::AllProperties )
11401140
{
11411141
refreshBackgroundColor( false );
11421142
}
1143-
if ( property == QgsLayoutObject::BlendMode || property == QgsLayoutObject::AllProperties )
1143+
if ( property == QgsLayoutObject::DataDefinedProperty::BlendMode || property == QgsLayoutObject::DataDefinedProperty::AllProperties )
11441144
{
11451145
refreshBlendMode();
11461146
}
1147-
if ( property == QgsLayoutObject::ExcludeFromExports || property == QgsLayoutObject::AllProperties )
1147+
if ( property == QgsLayoutObject::DataDefinedProperty::ExcludeFromExports || property == QgsLayoutObject::DataDefinedProperty::AllProperties )
11481148
{
11491149
const bool exclude = mExcludeFromExports;
11501150
//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 );
11521152
}
11531153

11541154
update();
@@ -1446,7 +1446,7 @@ void QgsLayoutItem::refreshItemRotation( QPointF *origin )
14461446
double r = mItemRotation;
14471447

14481448
//data defined rotation set?
1449-
r = mDataDefinedProperties.valueAsDouble( QgsLayoutItem::ItemRotation, createExpressionContext(), r );
1449+
r = mDataDefinedProperties.valueAsDouble( static_cast< int >( QgsLayoutObject::DataDefinedProperty::ItemRotation ), createExpressionContext(), r );
14501450

14511451
if ( qgsDoubleNear( r, rotation() ) && !origin )
14521452
{
@@ -1483,7 +1483,7 @@ void QgsLayoutItem::refreshItemRotation( QPointF *origin )
14831483
void QgsLayoutItem::refreshOpacity( bool updateItem )
14841484
{
14851485
//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 );
14871487

14881488
// Set the QGraphicItem's opacity
14891489
mEvaluatedOpacity = opacity / 100.0;
@@ -1511,7 +1511,7 @@ void QgsLayoutItem::refreshFrame( bool updateItem )
15111511

15121512
//data defined stroke color set?
15131513
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 );
15151515
QPen itemPen;
15161516
if ( ok )
15171517
{
@@ -1546,7 +1546,7 @@ void QgsLayoutItem::refreshBackgroundColor( bool updateItem )
15461546
{
15471547
//data defined fill color set?
15481548
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 );
15501550
if ( ok )
15511551
{
15521552
setBrush( QBrush( backgroundColor, Qt::SolidPattern ) );
@@ -1567,7 +1567,7 @@ void QgsLayoutItem::refreshBlendMode()
15671567

15681568
//data defined blend mode set?
15691569
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 );
15711571
if ( ok && !blendStr.isEmpty() )
15721572
{
15731573
const QString blendstr = blendStr.trimmed();

0 commit comments

Comments
 (0)