QmlDesigner: Fix preview rendering

We excluded item which had a node instance. For the preview all item should
be marked dirty.

Change-Id: I0cbad89707d7d94f65ac0d055488e124da40e7b3
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Marco Bubke
2013-06-18 14:57:34 +02:00
committed by Thomas Hartmann
parent 6b65e72dd5
commit 30d3e7e51d
5 changed files with 13 additions and 16 deletions

View File

@@ -103,12 +103,9 @@ void GraphicalNodeInstance::createEffectItem(bool createEffectItem)
s_createEffectItem = createEffectItem;
}
void GraphicalNodeInstance::updateDirtyNodeRecursive()
void GraphicalNodeInstance::updateAllDirtyNodesRecursive()
{
foreach (QQuickItem *childItem, quickItem()->childItems())
updateDirtyNodeRecursive(childItem);
DesignerSupport::updateDirtyNode(quickItem());
updateAllDirtyNodesRecursive(quickItem());
}
GraphicalNodeInstance::~GraphicalNodeInstance()
@@ -117,27 +114,27 @@ GraphicalNodeInstance::~GraphicalNodeInstance()
designerSupport()->derefFromEffectItem(quickItem());
}
void GraphicalNodeInstance::updateDirtyNodeRecursive(QQuickItem *parentItem) const
void GraphicalNodeInstance::updateDirtyNodesRecursive(QQuickItem *parentItem) const
{
foreach (QQuickItem *childItem, parentItem->childItems()) {
if (!nodeInstanceServer()->hasInstanceForObject(childItem))
updateDirtyNodeRecursive(childItem);
updateDirtyNodesRecursive(childItem);
}
DesignerSupport::updateDirtyNode(parentItem);
}
void GraphicalNodeInstance::updateAllDirtyNodeRecursive(QQuickItem *parentItem) const
void GraphicalNodeInstance::updateAllDirtyNodesRecursive(QQuickItem *parentItem) const
{
foreach (QQuickItem *childItem, parentItem->childItems())
updateDirtyNodeRecursive(childItem);
updateAllDirtyNodesRecursive(childItem);
DesignerSupport::updateDirtyNode(parentItem);
}
QImage GraphicalNodeInstance::renderImage() const
{
updateDirtyNodeRecursive(quickItem());
updateDirtyNodesRecursive(quickItem());
QRectF renderBoundingRect = boundingRect();