summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorMichael Dominic K <mdk@codethink.co.uk>2010-12-08 14:45:00 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-12-08 14:45:00 (GMT)
commitb850c43896d60b4dda21b01fdbdb15013cca48fa (patch)
tree51be53c2f3c5600e473fb5a61bb7338537410306 /src/opengl
parentc4f4d801f5dd31ca4c65c70b2245c987ac8ff203 (diff)
downloadQt-b850c43896d60b4dda21b01fdbdb15013cca48fa.zip
Qt-b850c43896d60b4dda21b01fdbdb15013cca48fa.tar.gz
Qt-b850c43896d60b4dda21b01fdbdb15013cca48fa.tar.bz2
Check Qt::WA_TranslucentBackground instead of custom widget property.
Merge-request: 2523 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qwindowsurface_gl.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index cd9ae01..f64b93c 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -379,19 +379,12 @@ void QGLWindowSurface::hijackWindow(QWidget *widget)
QGLContext *ctx = NULL;
- // Inspect the 'qglTranslucent' property of the target widget. If set to true,
- // we need to create the surface in a 32bit alpha-compatible format. This is
- // currently used by MeeGo graphics system extra API's. Could be in future
- // used by other platform-specific graphic system API's.
- if (widget->property("qglTranslucent").isValid()) {
+ // For translucent top-level widgets we need alpha in the format.
+ if (widget->testAttribute(Qt::WA_TranslucentBackground)) {
QGLFormat modFormat(surfaceFormat);
-
- if (widget->property("qglTranslucent").toBool() == true) {
- modFormat.setSampleBuffers(false);
- modFormat.setSamples(0);
- modFormat.setAlpha(true);
- }
-
+ modFormat.setSampleBuffers(false);
+ modFormat.setSamples(0);
+ modFormat.setAlpha(true);
ctx = new QGLContext(modFormat, widget);
} else
ctx = new QGLContext(surfaceFormat, widget);