Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a transparent window with Qt Quick?

Tags:

Is there a way to make the window of a qml application transparent?

I'm looking for a detailed description on how to draw simple shapes with qml while making the window of the application transparent, as well as the background. A working source code demo would be awesome.

like image 867
karlphillip Avatar asked Sep 30 '11 16:09

karlphillip


People also ask

How do you use Qt fast?

Creating and Running QML Projects For simple UI files such as this one, select File > New File or Project > Application (Qt Quick) > Qt Quick Application - Empty from within Qt Creator. Pressing the green Run button runs the application. You should see the text Hello, World! in the center of a red rectangle.

How do I create a quick Qt app?

To build applications for mobile devices, select kits also for Android and iOS. Note: Kits are listed if they have been specified in Edit > Preferences > Kits (on Windows and Linux) or in Qt Creator > Preferences > Kits (on macOS). For more information, see Adding Kits.


1 Answers

As of at least Qt 5.3 you don't need anything as elaborate as in the previous answers:

Window {     flags: Qt.ToolTip | Qt.FramelessWindowHint | Qt.WA_TranslucentBackground      color: "#00000000" 

Job done. (You might want to change ToolTip. I'm using it because I'm making tooltips.)

like image 94
Timmmm Avatar answered Oct 22 '22 07:10

Timmmm