summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Dominic K <mdk@codethink.co.uk>2010-12-08 12:48:22 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-12-08 12:48:22 (GMT)
commitf317d94880554a114937554907d08807c0cf5047 (patch)
tree91777cbdf9504c367d2421a4e377babdb11f8961 /src
parent299e27838df58153e76e5b3d9bee46dc2a867dec (diff)
downloadQt-f317d94880554a114937554907d08807c0cf5047.zip
Qt-f317d94880554a114937554907d08807c0cf5047.tar.gz
Qt-f317d94880554a114937554907d08807c0cf5047.tar.bz2
Support for 'qglTranslucent' in QGLWindowSurface.
Merge-request: 2523 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qwindowsurface_gl.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index bbb98d0..cd9ae01 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -377,7 +377,25 @@ void QGLWindowSurface::hijackWindow(QWidget *widget)
if (widgetPrivate->extraData()->glContext)
return;
- QGLContext *ctx = new QGLContext(surfaceFormat, 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()) {
+ QGLFormat modFormat(surfaceFormat);
+
+ if (widget->property("qglTranslucent").toBool() == true) {
+ modFormat.setSampleBuffers(false);
+ modFormat.setSamples(0);
+ modFormat.setAlpha(true);
+ }
+
+ ctx = new QGLContext(modFormat, widget);
+ } else
+ ctx = new QGLContext(surfaceFormat, widget);
+
ctx->create(qt_gl_share_widget()->context());
#ifndef QT_NO_EGL