From 0afa52f7ad93dec7558ecc9793d2115a9eac99cc Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 2 Oct 2014 12:03:27 +0200 Subject: 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 --- src/quick/items/qquickshadereffectsource.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/quick/items/qquickshadereffectsource.cpp') 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*))); -- cgit v1.2.3