aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickshadereffectsource.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@sletta.org>2014-10-02 12:03:27 +0200
committerGunnar Sletta <gunnar@sletta.org>2014-10-09 15:47:27 +0200
commit0afa52f7ad93dec7558ecc9793d2115a9eac99cc (patch)
tree9783381686a8a522f3de1b518a43a21bdde4f876 /src/quick/items/qquickshadereffectsource.cpp
parente89e9825cc47a02a195f41fb44a8d09e0ec1a84d (diff)
Relax ShaderEffectSource's sourceItem vs window handling.
For dynamically loaded items, the window may not be set on either the source or the item, so we need to be a bit more relaxed in our checking. This fixes a regression for dynamically loaded GaussianBlur. Change-Id: I3e888405a95058ca79ecd2dff42c0ed4c8fff065 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/items/qquickshadereffectsource.cpp')
-rw-r--r--src/quick/items/qquickshadereffectsource.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp
index 520a58a37b..52e5ba2464 100644
--- a/src/quick/items/qquickshadereffectsource.cpp
+++ b/src/quick/items/qquickshadereffectsource.cpp
@@ -324,7 +324,9 @@ void QQuickShaderEffectSource::setSourceItem(QQuickItem *item)
m_sourceItem = item;
if (m_sourceItem) {
- if (window() == m_sourceItem->window()) {
+ if (window() == m_sourceItem->window()
+ || (window() == 0 && m_sourceItem->window())
+ || (m_sourceItem->window() == 0 && window())) {
QQuickItemPrivate *d = QQuickItemPrivate::get(item);
// 'item' needs a window to get a scene graph node. It usually gets one through its
// parent, but if the source item is "inline" rather than a reference -- i.e.
@@ -332,6 +334,8 @@ void QQuickShaderEffectSource::setSourceItem(QQuickItem *item)
// In those cases, 'item' should get the window from 'this'.
if (window())
d->refWindow(window());
+ else if (m_sourceItem->window())
+ d->refWindow(m_sourceItem->window());
d->refFromEffectItem(m_hideSource);
d->addItemChangeListener(this, QQuickItemPrivate::Geometry);
connect(m_sourceItem, SIGNAL(destroyed(QObject*)), this, SLOT(sourceItemDestroyed(QObject*)));