summaryrefslogtreecommitdiff
path: root/share/qtcreator
diff options
context:
space:
mode:
Diffstat (limited to 'share/qtcreator')
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
index 9e100d0265..33931cbd70 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
@@ -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();
}