, m_componentComplete(true)
, m_wrapMode(QQuickShaderEffectSource::ClampToEdge)
, m_format(QQuickShaderEffectSource::RGBA)
+ , m_name("source")
, m_effectComponent(0)
, m_effect(0)
, m_effectSource(0)
{
- m_name = QLatin1String("source");
}
QQuickItemLayer::~QQuickItemLayer()
m_effect->stackAfter(m_effectSource);
}
m_effect->setVisible(m_item->isVisible());
- m_effect->setProperty(m_name.toLatin1(), qVariantFromValue<QObject *>(m_effectSource));
+ m_effect->setProperty(m_name, qVariantFromValue<QObject *>(m_effectSource));
}
void QQuickItemLayer::deactivateEffect()
\sa effect, ShaderEffect
*/
-void QQuickItemLayer::setName(const QString &name) {
+void QQuickItemLayer::setName(const QByteArray &name) {
if (m_name == name)
return;
if (m_effect) {
- m_effect->setProperty(m_name.toLatin1(), QVariant());
- m_effect->setProperty(name.toLatin1(), qVariantFromValue<QObject *>(m_effectSource));
+ m_effect->setProperty(m_name, QVariant());
+ m_effect->setProperty(name, qVariantFromValue<QObject *>(m_effectSource));
}
m_name = name;
emit nameChanged(name);
Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
Q_PROPERTY(QQuickShaderEffectSource::WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged)
Q_PROPERTY(QQuickShaderEffectSource::Format format READ format WRITE setFormat NOTIFY formatChanged)
- Q_PROPERTY(QString samplerName READ name WRITE setName NOTIFY nameChanged)
+ Q_PROPERTY(QByteArray samplerName READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QDeclarativeComponent *effect READ effect WRITE setEffect NOTIFY effectChanged)
public:
QQuickItemLayer(QQuickItem *item);
QQuickShaderEffectSource::WrapMode wrapMode() const { return m_wrapMode; }
void setWrapMode(QQuickShaderEffectSource::WrapMode mode);
- QString name() const { return m_name; }
- void setName(const QString &name);
+ QByteArray name() const { return m_name; }
+ void setName(const QByteArray &name);
QDeclarativeComponent *effect() const { return m_effectComponent; }
void setEffect(QDeclarativeComponent *effect);
void sizeChanged(const QSize &size);
void mipmapChanged(bool mipmap);
void wrapModeChanged(QQuickShaderEffectSource::WrapMode mode);
- void nameChanged(const QString &name);
+ void nameChanged(const QByteArray &name);
void effectChanged(QDeclarativeComponent *component);
void smoothChanged(bool smooth);
void formatChanged(QQuickShaderEffectSource::Format format);
QQuickShaderEffectSource::Format m_format;
QSize m_size;
QRectF m_sourceRect;
- QString m_name;
+ QByteArray m_name;
QDeclarativeComponent *m_effectComponent;
QQuickItem *m_effect;
QQuickShaderEffectSource *m_effectSource;