Commit 9898ac50 authored by Tim Jenssen's avatar Tim Jenssen
Browse files

QmlDesigner: fix that an invalid root item refreshes the preview



Change-Id: I8d917dfd92261a88472bd49577731f5bcf468d49
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent f0b58a22
......@@ -392,8 +392,15 @@ QImage QuickItemNodeInstance::renderPreviewImage(const QSize &previewImageSize)
{
QRectF previewItemBoundingRect = boundingRect();
if (previewItemBoundingRect.isValid() && quickItem())
return designerSupport()->renderImageForItem(quickItem(), previewItemBoundingRect, previewImageSize);
if (previewItemBoundingRect.isValid() && quickItem()) {
if (quickItem()->isVisible()) {
return designerSupport()->renderImageForItem(quickItem(), previewItemBoundingRect, previewImageSize);
} else {
QImage transparentImage(previewImageSize, QImage::Format_ARGB32_Premultiplied);
transparentImage.fill(Qt::transparent);
return transparentImage;
}
}
return QImage();
}
......
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