PDA

View Full Version : Transparent background of QWidget



sp
14th August 2013, 07:41
hi,
I have two overlapping widgets. On top widget, I am drawing a line using qpainter. I want to make background of top widget transparent so that bottom widget is visible alongwith line from top widget. Plz suggest some way to achieve that.

Rajesh.Rathod
14th August 2013, 08:00
set stylesheet of top widget, use background-color:rgba(0,0,0,0); in stylesheet.
As you are doing painting yourself, it's little doubtful.

if above doesn't work then see below link.
http://qt-project.org/doc/qt-4.8/qwidget.html#transparency-and-double-buffering

karankumar1609
14th August 2013, 10:11
Can you please explain why you need Top widget to just draw a single line?