QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
27 , mVisibleName( visibleName )
57 qDeleteAll( mMetadata );
62 if ( mMetadata.contains( name ) )
63 return mMetadata.value( name );
70 if ( !metadata || mMetadata.contains( metadata->
name() ) )
73 mMetadata[metadata->
name()] = metadata;
79 if ( !mMetadata.contains( name ) )
82 QgsPaintEffect *effect = mMetadata[name]->createPaintEffect( properties );
88 if ( element.isNull() )
93 QString type = element.attribute( QStringLiteral(
"type" ) );
106 QMap<QString, QgsPaintEffectAbstractMetadata *>::ConstIterator it = mMetadata.begin();
107 for ( ; it != mMetadata.end(); ++it )
109 lst.append( it.key() );
140 if ( effectStack->
count() != 5 )
143 for (
int i = 0; i < 5; ++i )
164 if ( sourceEffect->
blendMode() != QPainter::CompositionMode_SourceOver )
A paint effect which draws an offset and optionally blurred drop shadow within a picture.
QgsPaintEffect * createEffect(const QString &name, const QgsStringMap &properties=QgsStringMap()) const
Creates a new paint effect given the effect name and properties map.
bool addEffectType(QgsPaintEffectAbstractMetadata *metadata)
Registers a new effect type.
A paint effect which draws the source picture with minor or no alterations.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsInnerShadowEffect effect from a properties string map.
static QgsPaintEffect * defaultStack()
Returns a new effect stack consisting of a sensible selection of default effects.
QStringList effects() const
Returns a list of known paint effects.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsInnerGlowEffect effect from a properties string map.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsEffectStack effect.
static bool isDefaultStack(QgsPaintEffect *effect)
Tests whether a paint effect matches the default effects stack.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
A paint effect which draws an offset and optionally blurred drop shadow.
QgsPaintEffect * effect(int index) const
Returns a pointer to the effect at a specified index within the stack.
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...
QgsPaintEffectAbstractMetadata * effectMetadata(const QString &name) const
Returns the metadata for a specific effect.
void setEnabled(bool enabled)
Sets whether the effect is enabled.
A paint effect which draws a glow within a picture.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsOuterGlowEffect effect from a properties string map.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsDrawSource effect from a properties string map.
QMap< QString, QString > QgsStringMap
~QgsPaintEffectRegistry()
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsBlurEffect effect from a properties string map.
int count() const
Returns count of effects contained by the stack.
static QgsPaintEffectRegistry * paintEffectRegistry()
Returns the application's paint effect registry, used for managing paint effects.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
void appendEffect(QgsPaintEffect *effect)
Appends an effect to the end of the stack.
Base class for visual effects which can be applied to QPicture drawings.
A paint effect which draws a glow outside of a picture.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsDropShadowEffect effect from a properties string map.
bool enabled() const
Returns whether the effect is enabled.
static QgsPaintEffect * create(const QgsStringMap &map)
Creates a new QgsColorEffect effect from a properties string map.
double opacity() const
Returns the opacity for the effect.
A paint effect which consists of a stack of other chained paint effects.