[Development] How to set QQuickView TranslucentBackground

Samuel Rødal samuel.rodal at nokia.com
Thu Mar 8 09:17:08 CET 2012


On 03/08/2012 02:37 AM, ext hailong geng wrote:
> Hi
> What I have to say is that Qt5 is really cool, I love it ^_^
> But I get a problem, I want to show some lovely tools in desktop, in
> order to move them freely, I want to set the window Translucent and show
> the app in FullScreen mode(or in available screen geometry).In Qt4 I can
> set Qt::WA_TranslucentBackground and it works well. Now I want use Qt5
> to do that, but I can't find the way, I tried the following code and got
> only a grey background. I used the mine example to test and the code I
> have changed is marked in yellow.

This sounds like it needs to be solved at the QQuickCanvas-level 
somehow. Translucency in Qt 5 should work simply by setting a non-zero 
alpha in the QSurfaceFormat of the QWindow, and making sure to first 
clear the background with transparent.

--
Samuel



More information about the Development mailing list