From: Shawn Rutledge Date: Tue, 21 Aug 2012 17:20:11 +0000 (+0200) Subject: explain specifically how to make a transparent window X-Git-Tag: v5.0.0-beta1~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfe7bdbe9c8dd95d1cd42f724c21b677086a4d95;p=profile%2Fivi%2Fqtbase.git explain specifically how to make a transparent window Change-Id: I136d8d9709d4fae914f12919e513641a6e76e3f0 Task-number: QTBUG-20768 Reviewed-by: Samuel Rødal --- diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 44f3bc4..2dc62d6 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