diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-12-08 13:24:17 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-19 14:23:12 +0100 |
commit | 6efca58ab943bbd8c91c8f12ad47484677e2cf60 (patch) | |
tree | d1d5629d17451f36abaca975eed92d9132269e01 /tests/auto/qtquick2/qquickcanvas/data | |
parent | 8460eae44c241d5975b3041eedf6e08c9638fd41 (diff) |
Implement "headless mode" for hidden QQuickCanvases
When all views are hidden, we stop the rendering thread,
kill the OpenGL context and all scene graph content.
The entire scenegraph is recreated based on the QML scene
when a view is shown again.
Change-Id: I734619d9f29263a5cdecbcc9b88c3808d1d64a7f
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Diffstat (limited to 'tests/auto/qtquick2/qquickcanvas/data')
-rw-r--r-- | tests/auto/qtquick2/qquickcanvas/data/Headless.qml | 33 | ||||
-rw-r--r-- | tests/auto/qtquick2/qquickcanvas/data/colors.png | bin | 0 -> 1655 bytes |
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qquickcanvas/data/Headless.qml b/tests/auto/qtquick2/qquickcanvas/data/Headless.qml new file mode 100644 index 0000000000..2e09cb1f24 --- /dev/null +++ b/tests/auto/qtquick2/qquickcanvas/data/Headless.qml @@ -0,0 +1,33 @@ +import QtQuick 2.0 +import QtQuick.Window 2.0 as Window + +Window.Window { + + width: 300 + height: 200 + visible: true + + Text { + anchors.left: parent.left + anchors.top: parent.top + text: "Testing headless mode" + } + + Rectangle { + anchors.centerIn: parent + width: 100 + height: 50 + rotation: -30 + gradient: Gradient { + GradientStop { position: 0; color: "lightsteelblue" } + GradientStop { position: 1; color: "black" } + } + } + + Image { + source: "colors.png" + anchors.bottom: parent.bottom + anchors.right: parent.right + } + +} diff --git a/tests/auto/qtquick2/qquickcanvas/data/colors.png b/tests/auto/qtquick2/qquickcanvas/data/colors.png Binary files differnew file mode 100644 index 0000000000..dfb62f3d64 --- /dev/null +++ b/tests/auto/qtquick2/qquickcanvas/data/colors.png |