Commit 30d3e7e5 authored by Marco Bubke's avatar Marco Bubke Committed by Thomas Hartmann

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: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 6b65e72d
......@@ -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();
......
......@@ -40,7 +40,7 @@ public:
QList<ServerNodeInstance> childItems() const;
void updateDirtyNodeRecursive();
void updateAllDirtyNodesRecursive();
static void createEffectItem(bool createEffectItem);
int penWidth() const;
......@@ -64,8 +64,8 @@ protected:
void setHasContent(bool hasContent);
DesignerSupport *designerSupport() const;
Qt5NodeInstanceServer *qt5NodeInstanceServer() const;
void updateDirtyNodeRecursive(QQuickItem *parentItem) const;
void updateAllDirtyNodeRecursive(QQuickItem *parentItem) const;
void updateDirtyNodesRecursive(QQuickItem *parentItem) const;
void updateAllDirtyNodesRecursive(QQuickItem *parentItem) const;
QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const;
void resetHorizontal();
void resetVertical();
......
......@@ -459,7 +459,7 @@ QVariant ObjectNodeInstance::fixResourcePaths(const QVariant &value)
return value;
}
void ObjectNodeInstance::updateDirtyNodeRecursive()
void ObjectNodeInstance::updateAllDirtyNodesRecursive()
{
}
......
......@@ -186,7 +186,7 @@ public:
static QVariant fixResourcePaths(const QVariant &value);
virtual void updateDirtyNodeRecursive();
virtual void updateAllDirtyNodesRecursive();
protected:
explicit ObjectNodeInstance(QObject *object);
......
......@@ -158,7 +158,7 @@ bool ServerNodeInstance::holdsGraphical() const
void ServerNodeInstance::updateDirtyNodeRecursive()
{
m_nodeInstance->updateDirtyNodeRecursive();
m_nodeInstance->updateAllDirtyNodesRecursive();
}
bool ServerNodeInstance::isSubclassOf(const QString &superTypeName) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment