summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@nokia.com>2012-08-21 19:20:11 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-25 19:04:56 +0200
commitdfe7bdbe9c8dd95d1cd42f724c21b677086a4d95 (patch)
treec7d631b304455a869c2188629fe05c6aeb92fdba /src/gui/kernel
parent77e57387ac7d4f6187867059797a1d6587351ddb (diff)
explain specifically how to make a transparent window
Change-Id: I136d8d9709d4fae914f12919e513641a6e76e3f0 Task-number: QTBUG-20768 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 44f3bc4ea9..2dc62d642d 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -435,8 +435,16 @@ void QWindow::setWindowModality(Qt::WindowModality modality)
/*!
Sets the window's surface \a format.
- The format determines properties such as color depth, alpha,
- depth and stencil buffer size, etc.
+ The format determines properties such as color depth, alpha, depth and
+ stencil buffer size, etc. For example, to give a window a transparent
+ background (provided that the window system supports compositing, and
+ provided that other content in the window does not make it opaque again):
+
+ \code
+ QSurfaceFormat format;
+ format.setAlphaBufferSize(8);
+ window.setFormat(format);
+ \endcode
The surface format will be resolved in the create() function. Calling
this function after create() has been called will not re-resolve the