diff options
author | Michael Dominic K <mdk@codethink.co.uk> | 2010-12-08 14:45:00 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-12-08 14:45:00 (GMT) |
commit | b850c43896d60b4dda21b01fdbdb15013cca48fa (patch) | |
tree | 51be53c2f3c5600e473fb5a61bb7338537410306 /src | |
parent | c4f4d801f5dd31ca4c65c70b2245c987ac8ff203 (diff) | |
download | Qt-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')
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 17 |
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); |