Skip to content

Commit 9b19e06

Browse files
committedJul 25, 2020
Allow symbol and color ramp visitors the ability to edit symbols/color ramps they visit
1 parent 8b5dedf commit 9b19e06

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed
 

‎python/core/auto_generated/symbology/qgsstyle.sip.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ A symbol entity for QgsStyle databases.
11081108
%End
11091109
public:
11101110

1111-
QgsStyleSymbolEntity( const QgsSymbol *symbol );
1111+
QgsStyleSymbolEntity( QgsSymbol *symbol );
11121112
%Docstring
11131113
Constructor for QgsStyleSymbolEntity, with the specified ``symbol``.
11141114

@@ -1118,7 +1118,7 @@ Ownership of ``symbol`` is NOT transferred.
11181118
virtual QgsStyle::StyleEntity type() const;
11191119

11201120

1121-
const QgsSymbol *symbol() const;
1121+
QgsSymbol *symbol() const;
11221122
%Docstring
11231123
Returns the entity's symbol.
11241124
%End
@@ -1138,7 +1138,7 @@ A color ramp entity for QgsStyle databases.
11381138
%End
11391139
public:
11401140

1141-
QgsStyleColorRampEntity( const QgsColorRamp *ramp );
1141+
QgsStyleColorRampEntity( QgsColorRamp *ramp );
11421142
%Docstring
11431143
Constructor for QgsStyleColorRampEntity, with the specified color ``ramp``.
11441144

@@ -1148,7 +1148,7 @@ Ownership of ``ramp`` is NOT transferred.
11481148
virtual QgsStyle::StyleEntity type() const;
11491149

11501150

1151-
const QgsColorRamp *ramp() const;
1151+
QgsColorRamp *ramp() const;
11521152
%Docstring
11531153
Returns the entity's color ramp.
11541154
%End

‎src/core/layout/qgslayoutitempage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ QgsLayoutItem::ExportLayerBehavior QgsLayoutItemPage::exportLayerBehavior() cons
211211

212212
bool QgsLayoutItemPage::accept( QgsStyleEntityVisitorInterface *visitor ) const
213213
{
214-
QgsStyleSymbolEntity entity( pageStyleSymbol() );
214+
QgsStyleSymbolEntity entity( mPageStyleSymbol.get() );
215215
if ( !visitor->visit( QgsStyleEntityVisitorInterface::StyleLeaf( &entity, QStringLiteral( "page" ), QObject::tr( "Page" ) ) ) )
216216
return false;
217217
return true;

‎src/core/symbology/qgsstyle.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ class CORE_EXPORT QgsStyleSymbolEntity : public QgsStyleEntityInterface
11401140
*
11411141
* Ownership of \a symbol is NOT transferred.
11421142
*/
1143-
QgsStyleSymbolEntity( const QgsSymbol *symbol )
1143+
QgsStyleSymbolEntity( QgsSymbol *symbol )
11441144
: mSymbol( symbol )
11451145
{}
11461146

@@ -1149,11 +1149,11 @@ class CORE_EXPORT QgsStyleSymbolEntity : public QgsStyleEntityInterface
11491149
/**
11501150
* Returns the entity's symbol.
11511151
*/
1152-
const QgsSymbol *symbol() const { return mSymbol; }
1152+
QgsSymbol *symbol() const { return mSymbol; }
11531153

11541154
private:
11551155

1156-
const QgsSymbol *mSymbol = nullptr;
1156+
QgsSymbol *mSymbol = nullptr;
11571157

11581158
};
11591159

@@ -1172,7 +1172,7 @@ class CORE_EXPORT QgsStyleColorRampEntity : public QgsStyleEntityInterface
11721172
*
11731173
* Ownership of \a ramp is NOT transferred.
11741174
*/
1175-
QgsStyleColorRampEntity( const QgsColorRamp *ramp )
1175+
QgsStyleColorRampEntity( QgsColorRamp *ramp )
11761176
: mRamp( ramp )
11771177
{}
11781178

@@ -1181,11 +1181,11 @@ class CORE_EXPORT QgsStyleColorRampEntity : public QgsStyleEntityInterface
11811181
/**
11821182
* Returns the entity's color ramp.
11831183
*/
1184-
const QgsColorRamp *ramp() const { return mRamp; }
1184+
QgsColorRamp *ramp() const { return mRamp; }
11851185

11861186
private:
11871187

1188-
const QgsColorRamp *mRamp = nullptr;
1188+
QgsColorRamp *mRamp = nullptr;
11891189
};
11901190

11911191
/**

0 commit comments

Comments
 (0)
Please sign in to comment.