From c884f629d6195916ae6265dab623d279a599acd1 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 22 May 2013 16:55:04 +0200 Subject: QmlDesigner.Instances: custom rendering for QQuickWindow Change-Id: Id2d9bd6b7f5cecefffddece30bb93a69699beeff Reviewed-by: Marco Bubke --- .../qml2puppet/instances/quickwindownodeinstance.cpp | 18 ++++++++++++++++++ .../qml2puppet/instances/quickwindownodeinstance.h | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.cpp index d5a87c7c48..07645ff281 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.cpp @@ -52,6 +52,24 @@ QObject *QuickWindowNodeInstance::parent() const return 0; } +QImage QuickWindowNodeInstance::renderImage() const +{ + /* + Since the content item transucient + we just fill an image with the window color + */ + + QRectF renderBoundingRect = boundingRect(); + + QImage renderImage(renderBoundingRect.size().toSize(), QImage::Format_ARGB32_Premultiplied); + + QPalette palette; + + renderImage.fill(palette.color(QPalette::Window).rgba()); + + return renderImage; +} + QuickWindowNodeInstance::Pointer QuickWindowNodeInstance::create(QObject *object) { QQuickWindow *quickWindow = qobject_cast(object); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.h index e9651f9e68..c9c7773d3a 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.h @@ -62,7 +62,7 @@ public: bool isAnchoredBySibling() const Q_DECL_OVERRIDE; - + QImage renderImage() const Q_DECL_OVERRIDE; protected: QuickWindowNodeInstance(QQuickWindow*); -- cgit v1.2.3