forked from qt-creator/qt-creator
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/3972 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user