diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-09-23 17:44:19 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-09-28 07:41:36 +0000 |
commit | 6fa50ffc31fcca051c73eeaa94116f2667b9ae6b (patch) | |
tree | ca4298370d276afe10f1075c50352c80f0e218b6 /src/quickwidgets | |
parent | d37a0145cdec131ef6f689310530ce92c4ba5e05 (diff) |
Fix up flawed TranslucentBackground usage in docs and examples
Following the qtbase fixes, start doing things correctly in the
QQuickWidget examples too. Remove the checkbox and use a --transparent
command line argument (like in hellogl2).
In addition --transparent --no_render_alpha can be used to verify the
most problematic case: when alpha is present and the backingstore contains
semi-transparent pixels in places where the underlying QOpenGLWidget is
opaque. Here the result must still be an opaque pixel. This was previously
ensured by a glColorMask call, now replaced by glBlendFuncSeparate in
QPlatformBackingStore.
Task-number: QTBUG-47276
Change-Id: Ia040f899405f73e95e957becee5df43683af9c39
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quickwidgets')
-rw-r--r-- | src/quickwidgets/qquickwidget.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index 47bcabc115..9cfec370f9 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -345,8 +345,8 @@ QObject *QQuickWidgetPrivate::focusObject() This limitation only applies when there are other widgets underneath the QQuickWidget inside the same window. Making the window semi-transparent, with other applications and the desktop visible in the background, is done in the traditional way: Set - Qt::WA_TranslucentBackground and change the Qt Quick Scenegraph's clear color to - Qt::transparent via setClearColor(). + Qt::WA_TranslucentBackground on the top-level window, request an alpha channel, and + change the Qt Quick Scenegraph's clear color to Qt::transparent via setClearColor(). \sa {Exposing Attributes of C++ Types to QML}, {Qt Quick Widgets Example}, QQuickView */ @@ -1293,9 +1293,10 @@ QImage QQuickWidget::grabFramebuffer() const /*! Sets the clear \a color. By default this is an opaque color. - To get a semi- or fully transparent QQuickWidget, call this function with \a - color set to Qt::transparent and set the Qt::WA_TranslucentBackground widget - attribute. + To get a semi-transparent QQuickWidget, call this function with + \a color set to Qt::transparent, set the Qt::WA_TranslucentBackground + widget attribute on the top-level window, and request an alpha + channel via setFormat(). \sa QQuickWindow::setColor() */ |