diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2011-04-28 14:50:41 +0200 |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2011-04-29 16:31:43 +0200 |
commit | a7a4c75918f6d1f8b2fc3e5e4e2f935690516451 (patch) | |
tree | 5e1f16e604785161ee2133995f6d9d21de38f9b7 | |
parent | ade28f1bbd22d726ceba80a42abf33731b6d731f (diff) |
Fixed signal passing between nested ShaderEffectItems.
5 files changed, 10 insertions, 7 deletions
diff --git a/src/declarative/items/qsgshadereffectitem.cpp b/src/declarative/items/qsgshadereffectitem.cpp index 286b67bacd..40ec25c2cc 100644 --- a/src/declarative/items/qsgshadereffectitem.cpp +++ b/src/declarative/items/qsgshadereffectitem.cpp @@ -435,7 +435,7 @@ QSGNode *QSGShaderEffectItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeD textures.append(qMakePair(source.name, source.item)); QSGTextureProvider *t = QSGTextureProvider::from(source.item); if (t && t->textureChangedSignal()) - connect(source.item, t->textureChangedSignal(), node, SLOT(markDirtyTexture())); + connect(source.item, t->textureChangedSignal(), node, SLOT(markDirtyTexture()), Qt::DirectConnection); } m_material.setUniforms(values); m_material.setTextureProviders(textures); diff --git a/src/declarative/items/qsgshadereffectsource.cpp b/src/declarative/items/qsgshadereffectsource.cpp index 36d380b15f..2f01c862d6 100644 --- a/src/declarative/items/qsgshadereffectsource.cpp +++ b/src/declarative/items/qsgshadereffectsource.cpp @@ -192,7 +192,7 @@ void QSGShaderEffectTexture::grab() if (!m_renderer) { m_renderer = context->createRenderer(); - connect(m_renderer, SIGNAL(sceneGraphChanged()), this, SLOT(markDirtyTexture())); + connect(m_renderer, SIGNAL(sceneGraphChanged()), this, SLOT(markDirtyTexture()), Qt::DirectConnection); } m_renderer->setRootNode(static_cast<QSGRootNode *>(root)); @@ -292,6 +292,7 @@ QSGShaderEffectSource::QSGShaderEffectSource(QSGItem *parent) { setFlag(ItemHasContents); m_texture = new QSGShaderEffectTexture(this); + connect(m_texture, SIGNAL(textureChanged()), this, SIGNAL(textureChanged()), Qt::DirectConnection); } QSGShaderEffectSource::~QSGShaderEffectSource() diff --git a/src/declarative/items/qsgshadereffectsource_p.h b/src/declarative/items/qsgshadereffectsource_p.h index d8c4a18df1..1b6e1b5fe8 100644 --- a/src/declarative/items/qsgshadereffectsource_p.h +++ b/src/declarative/items/qsgshadereffectsource_p.h @@ -99,6 +99,9 @@ public: void grab(); +Q_SIGNALS: + void textureChanged(); + public Q_SLOTS: void markDirtyTexture(); @@ -183,7 +186,7 @@ public: void setMipmap(bool enabled); QSGTexture *texture() const; - const char *textureChangedSignal() const { return SIGNAL(textureChanged); } + const char *textureChangedSignal() const { return SIGNAL(textureChanged()); } Q_INVOKABLE void grab(); @@ -197,6 +200,8 @@ Q_SIGNALS: void hideSourceChanged(); void mipmapChanged(); + void textureChanged(); + protected: virtual QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *); diff --git a/src/declarative/scenegraph/util/qsgtexture.h b/src/declarative/scenegraph/util/qsgtexture.h index 807dbecae5..9b95ef36ad 100644 --- a/src/declarative/scenegraph/util/qsgtexture.h +++ b/src/declarative/scenegraph/util/qsgtexture.h @@ -123,9 +123,6 @@ class QSGDynamicTexture : public QSGTexture Q_OBJECT public: virtual bool updateTexture() = 0; - -Q_SIGNALS: - void textureChanged(); }; QT_END_NAMESPACE diff --git a/src/declarative/scenegraph/util/qsgtextureprovider_p.h b/src/declarative/scenegraph/util/qsgtextureprovider_p.h index 1e0e9f6c68..486e7d5882 100644 --- a/src/declarative/scenegraph/util/qsgtextureprovider_p.h +++ b/src/declarative/scenegraph/util/qsgtextureprovider_p.h @@ -57,7 +57,7 @@ class QSGTextureProvider { public: virtual QSGTexture *texture() const = 0; - virtual const char *textureChangedSignal() { return 0; } + virtual const char *textureChangedSignal() const { return 0; } static QSGTextureProvider *from(QObject *object); }; |