Skip to content

Commit

Permalink
Allow symbol and color ramp visitors the ability to edit symbols/colo…
Browse files Browse the repository at this point in the history
…r ramps they visit
  • Loading branch information
nyalldawson committed Jul 25, 2020
1 parent 8b5dedf commit 9b19e06
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions python/core/auto_generated/symbology/qgsstyle.sip.in
Expand Up @@ -1108,7 +1108,7 @@ A symbol entity for QgsStyle databases.
%End
public:

QgsStyleSymbolEntity( const QgsSymbol *symbol );
QgsStyleSymbolEntity( QgsSymbol *symbol );
%Docstring
Constructor for QgsStyleSymbolEntity, with the specified ``symbol``.

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


const QgsSymbol *symbol() const;
QgsSymbol *symbol() const;
%Docstring
Returns the entity's symbol.
%End
Expand All @@ -1138,7 +1138,7 @@ A color ramp entity for QgsStyle databases.
%End
public:

QgsStyleColorRampEntity( const QgsColorRamp *ramp );
QgsStyleColorRampEntity( QgsColorRamp *ramp );
%Docstring
Constructor for QgsStyleColorRampEntity, with the specified color ``ramp``.

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


const QgsColorRamp *ramp() const;
QgsColorRamp *ramp() const;
%Docstring
Returns the entity's color ramp.
%End
Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutitempage.cpp
Expand Up @@ -211,7 +211,7 @@ QgsLayoutItem::ExportLayerBehavior QgsLayoutItemPage::exportLayerBehavior() cons

bool QgsLayoutItemPage::accept( QgsStyleEntityVisitorInterface *visitor ) const
{
QgsStyleSymbolEntity entity( pageStyleSymbol() );
QgsStyleSymbolEntity entity( mPageStyleSymbol.get() );
if ( !visitor->visit( QgsStyleEntityVisitorInterface::StyleLeaf( &entity, QStringLiteral( "page" ), QObject::tr( "Page" ) ) ) )
return false;
return true;
Expand Down
12 changes: 6 additions & 6 deletions src/core/symbology/qgsstyle.h
Expand Up @@ -1140,7 +1140,7 @@ class CORE_EXPORT QgsStyleSymbolEntity : public QgsStyleEntityInterface
*
* Ownership of \a symbol is NOT transferred.
*/
QgsStyleSymbolEntity( const QgsSymbol *symbol )
QgsStyleSymbolEntity( QgsSymbol *symbol )
: mSymbol( symbol )
{}

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

private:

const QgsSymbol *mSymbol = nullptr;
QgsSymbol *mSymbol = nullptr;

};

Expand All @@ -1172,7 +1172,7 @@ class CORE_EXPORT QgsStyleColorRampEntity : public QgsStyleEntityInterface
*
* Ownership of \a ramp is NOT transferred.
*/
QgsStyleColorRampEntity( const QgsColorRamp *ramp )
QgsStyleColorRampEntity( QgsColorRamp *ramp )
: mRamp( ramp )
{}

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

private:

const QgsColorRamp *mRamp = nullptr;
QgsColorRamp *mRamp = nullptr;
};

/**
Expand Down

0 comments on commit 9b19e06

Please sign in to comment.