summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@digia.com>2013-05-22 16:55:04 +0200
committerThomas Hartmann <Thomas.Hartmann@digia.com>2013-05-23 15:35:46 +0200
commitc884f629d6195916ae6265dab623d279a599acd1 (patch)
tree890d85e7a3ee35ce5bb3b60b04f0acb7e1365bfc
parent4786cee969dc005b24214bca49476f8f9cf667fc (diff)
downloadqt-creator-c884f629d6195916ae6265dab623d279a599acd1.tar.gz
QmlDesigner.Instances: custom rendering for QQuickWindow
Change-Id: Id2d9bd6b7f5cecefffddece30bb93a69699beeff Reviewed-by: Marco Bubke <marco.bubke@digia.com>
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.cpp18
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickwindownodeinstance.h2
2 files changed, 19 insertions, 1 deletions
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<QQuickWindow*>(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*);