19 #include <QStandardItem> 21 #include <QMessageBox> 35 if ( !abstractMetadata )
37 QgsDebugMsg(
QString(
"Failed to find paint effect entry in registry: %1" ).arg( name ) );
52 static bool initialized =
false;
76 populateEffectTypes();
80 int idx = mEffectTypeCombo->findData( effect->
type() );
81 mEffectTypeCombo->setCurrentIndex( idx );
84 updateEffectWidget( effect );
89 void QgsPaintEffectPropertiesWidget::populateEffectTypes()
94 Q_FOREACH (
const QString& type, types )
97 if ( type ==
"effectStack" )
104 void QgsPaintEffectPropertiesWidget::updateEffectWidget(
QgsPaintEffect* effect )
108 stackedWidget->setCurrentWidget( pageDummy );
112 if ( stackedWidget->currentWidget() != pageDummy )
116 stackedWidget->removeWidget( stackedWidget->currentWidget() );
127 stackedWidget->addWidget( w );
128 stackedWidget->setCurrentWidget( w );
135 stackedWidget->setCurrentWidget( pageDummy );
144 QString newEffectType = mEffectTypeCombo->itemData( mEffectTypeCombo->currentIndex() ).toString();
145 if ( effect->
type() == newEffectType )
160 updateEffectWidget( newEffect );
virtual QgsStringMap properties() const =0
Returns the properties describing the paint effect encoded in a string format.
Base class for visual effects which can be applied to QPicture drawings.
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
static QgsPaintEffectRegistry * instance()
Returns a reference to the singleton instance of the paint effect registry.
virtual QString type() const =0
Returns the effect type.
QgsPaintEffectWidget *(* QgsPaintEffectWidgetFunc)()
QStringList effects() const
Returns a list of known paint effects.
QgsPaintEffectAbstractMetadata * effectMetadata(const QString &name) const
Returns the metadata for a specific effect.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Singleton registry of available paint effects.