Skip to content
Permalink
Browse files

Allow symbol and color ramp visitors the ability to edit symbols/colo…

…r ramps they visit
  • Loading branch information
nyalldawson committed Jul 25, 2020
1 parent 8b5dedf commit 9b19e069b36ecfd7fe2b6be1ea44efacd074fa82
@@ -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``.

@@ -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
@@ -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``.

@@ -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
@@ -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;
@@ -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 )
{}

@@ -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;

};

@@ -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 )
{}

@@ -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;
};

/**

0 comments on commit 9b19e06

Please sign in to comment.
You can’t perform that action at this time.