26 , mVisibleName( visibleName )
56 qDeleteAll( mMetadata );
61 if ( mMetadata.contains( name ) )
62 return mMetadata.value( name );
69 if ( !metadata || mMetadata.contains( metadata->
name() ) )
72 mMetadata[metadata->
name()] = metadata;
78 if ( !mMetadata.contains( name ) )
87 if ( element.isNull() )
92 QString type = element.attribute( QStringLiteral(
"type" ) );
105 QMap<QString, QgsPaintEffectAbstractMetadata *>::ConstIterator it = mMetadata.begin();
106 for ( ; it != mMetadata.end(); ++it )
108 lst.append( it.key() );
139 if ( effectStack->
count() != 5 )
142 for (
int i = 0; i < 5; ++i )
149 if ( !dynamic_cast< QgsDropShadowEffect * >( effectStack->
effect( 0 ) ) )
151 if ( !dynamic_cast< QgsOuterGlowEffect * >( effectStack->
effect( 1 ) ) )
153 if ( !dynamic_cast< QgsDrawSourceEffect * >( effectStack->
effect( 2 ) ) )
155 if ( !dynamic_cast< QgsInnerShadowEffect * >( effectStack->
effect( 3 ) ) )
157 if ( !dynamic_cast< QgsInnerGlowEffect * >( effectStack->
effect( 4 ) ) )
163 if ( sourceEffect->
blendMode() != QPainter::CompositionMode_SourceOver )
bool addEffectType(QgsPaintEffectAbstractMetadata *metadata)
Registers a new effect type.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
static bool isDefaultStack(QgsPaintEffect *effect)
Tests whether a paint effect matches the default effects stack.
bool enabled() const
Returns whether the effect is enabled.
Base class for visual effects which can be applied to QPicture drawings.
QMap< QString, QString > QgsStringMap
QStringList effects() const
Returns a list of known paint effects.
static QgsPaintEffectRegistry * paintEffectRegistry()
Returns the application's paint effect registry, used for managing paint effects. ...
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsEffectStack effect.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsDrawSource effect from a properties string map.
void setEnabled(bool enabled)
Sets whether the effect is enabled.
int count() const
Returns count of effects contained by the stack.
static QgsPaintEffect * defaultStack()
Returns a new effect stack consisting of a sensible selection of default effects. ...
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsOuterGlowEffect effect from a properties string map.
A paint effect which consists of a stack of other chained paint effects.
QgsPaintEffectAbstractMetadata * effectMetadata(const QString &name) const
Returns the metadata for a specific effect.
void appendEffect(QgsPaintEffect *effect)
Appends an effect to the end of the stack.
A paint effect which draws an offset and optionally blurred drop shadow.
A paint effect which draws a glow outside of a picture.
double opacity() const
Returns the opacity for the effect.
virtual void readProperties(const QgsStringMap &props)=0
Reads a string map of an effect's properties and restores the effect to the state described by the pr...
A paint effect which draws an offset and optionally blurred drop shadow within a picture.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsBlurEffect effect from a properties string map.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsColorEffect effect from a properties string map.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsInnerShadowEffect effect from a properties string map.
~QgsPaintEffectRegistry()
A paint effect which draws a glow within a picture.
A paint effect which draws the source picture with minor or no alterations.
QgsPaintEffect * effect(int index) const
Returns a pointer to the effect at a specified index within the stack.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsInnerGlowEffect effect from a properties string map.
QgsPaintEffect * createEffect(const QString &name, const QgsStringMap &properties=QgsStringMap()) const
Creates a new paint effect given the effect name and properties map.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsDropShadowEffect effect from a properties string map.