Fixed signal passing between nested ShaderEffectItems.
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>
Thu, 28 Apr 2011 12:50:41 +0000 (14:50 +0200)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>
Fri, 29 Apr 2011 14:31:43 +0000 (16:31 +0200)
src/declarative/items/qsgshadereffectitem.cpp
src/declarative/items/qsgshadereffectsource.cpp
src/declarative/items/qsgshadereffectsource_p.h
src/declarative/scenegraph/util/qsgtexture.h
src/declarative/scenegraph/util/qsgtextureprovider_p.h

index 286b67b..40ec25c 100644 (file)
@@ -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);
index 36d380b..2f01c86 100644 (file)
@@ -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()
index d8c4a18..1b6e1b5 100644 (file)
@@ -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 *);
 
index 807dbec..9b95ef3 100644 (file)
@@ -123,9 +123,6 @@ class QSGDynamicTexture : public QSGTexture
     Q_OBJECT
 public:
     virtual bool updateTexture() = 0;
-
-Q_SIGNALS:
-    void textureChanged();
 };
 
 QT_END_NAMESPACE
index 1e0e9f6..486e7d5 100644 (file)
@@ -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);
 };