Commit 9250b611 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner.NodeInstances: Fix image rendering

Call DesignerSupport::updateDirtyNode() recursively for every item which is
not under our control.

Change-Id: Ie6c784965d1557ece81176fc405864f1328733f7
Reviewed-on: http://codereview.qt.nokia.com/3972Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 50d1087a
......@@ -184,14 +184,24 @@ bool SGItemNodeInstance::equalSGItem(QSGItem *item) const
return item == sgItem();
}
void SGItemNodeInstance::updateDirtyNodeRecursive(QSGItem *parentItem) const
{
DesignerSupport::updateDirtyNode(parentItem);
foreach (QSGItem *childItem, parentItem->childItems()) {
if (!nodeInstanceServer()->hasInstanceForObject(childItem))
updateDirtyNodeRecursive(childItem);
}
}
QImage SGItemNodeInstance::renderImage() const
{
updateDirtyNodeRecursive(sgItem());
QImage image = designerSupport()->renderImageForItem(sgItem());
image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
qDebug() << __FUNCTION__ << image.size();
return image;
}
......
......@@ -116,6 +116,7 @@ protected:
void resetVertical();
void refresh();
QRectF boundingRectWithStepChilds(QSGItem *parentItem) const;
void updateDirtyNodeRecursive(QSGItem *parentItem) const;
private: //variables
bool m_hasHeight;
......
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