aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-05-29 10:29:08 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-30 14:19:02 +0200
commit84adf4ff5b6b459c5dfc084b12f8ce6b58e5f5b7 (patch)
tree39593b5cf5666db3050b79e4bc6547377275b173 /examples/quick
parent5e3d81ecfe0a14be2e1028a15df80df16d301db2 (diff)
Added QQuickWindow::setDefaultAlphaBuffer()
All QQuickWindows will render using the same OpenGL context, so for a window to support transparency, the OpenGL context needs to be created with support for transparency from the very start. Therefore the application needs to call setDefaultAlphaBuffer() before creating windows. There are some relevant comments in QTBUG-20768 although the bug itself is not the same use case (it was already OK as long as the first window had a translucent color, because of setAlphaBufferSize in QQuickWindow::setColor()). Change-Id: I92e111c1a62c0d510821b646fd334e52254f8f57 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/window/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/quick/window/main.cpp b/examples/quick/window/main.cpp
index 2223c607b4..7872c7183c 100644
--- a/examples/quick/window/main.cpp
+++ b/examples/quick/window/main.cpp
@@ -41,6 +41,7 @@
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
+#include <QtQuick/QQuickWindow>
#include <QtCore/QUrl>
#include <QDebug>
@@ -49,6 +50,7 @@ int main(int argc, char* argv[])
QGuiApplication app(argc, argv);
QQmlEngine engine;
QQmlComponent component(&engine);
+ QQuickWindow::setDefaultAlphaBuffer(true);
component.loadUrl(QUrl("qrc:///window/window.qml"));
if ( component.isReady() )
component.create();