forked from qt-creator/qt-creator
QmlDesigner: Fix root item effect rendering
ShaderEffects affecting root item are now correctly triggering root item render if they have changes. Fixes: QDS-15085 Change-Id: I7e675a9514e0de0a45d0709ff5e59e8371700b45 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -189,10 +189,21 @@ QList<QQuickItem*> subItems(QQuickItem *parentItem)
|
||||
|
||||
const QList<QQuickItem*> Qt5NodeInstanceServer::allItems() const
|
||||
{
|
||||
if (rootNodeInstance().isValid())
|
||||
return rootNodeInstance().allItemsRecursive();
|
||||
if (!rootNodeInstance().isValid())
|
||||
return {};
|
||||
|
||||
return {};
|
||||
QList<QQuickItem*> allItems = rootNodeInstance().allItemsRecursive();
|
||||
|
||||
// ShaderEffects affecting root item will be root item siblings, so add those as well
|
||||
QQuickItem *rootItem = rootNodeInstance().rootQuickItem();
|
||||
if (rootItem && rootItem->parentItem()) {
|
||||
const QList<QQuickItem *> siblings = rootItem->parentItem()->childItems();
|
||||
for (QQuickItem *sibling : siblings) {
|
||||
if (sibling != rootItem)
|
||||
allItems.append(sibling);
|
||||
}
|
||||
}
|
||||
return allItems;
|
||||
}
|
||||
|
||||
bool Qt5NodeInstanceServer::rootIsRenderable3DObject() const
|
||||
|
@@ -163,7 +163,9 @@ ServerNodeInstance Qt5RenderNodeInstanceServer::findNodeInstanceForItem(QQuickIt
|
||||
if (item) {
|
||||
if (hasInstanceForObject(item))
|
||||
return instanceForObject(item);
|
||||
else if (item->parentItem())
|
||||
else if (item == rootNodeInstance().rootQuickItem()->parentItem())
|
||||
return rootNodeInstance();
|
||||
else
|
||||
return findNodeInstanceForItem(item->parentItem());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user