PDA

View Full Version : How to Set Transparency for Child QWidget



Rambabu
1st March 2017, 09:42
I am using following code to set the transparency for child widget but the output is showing as full white.

setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_TranslucentBackground, true);
setAttribute(Qt::WA_PaintOnScreen);

I set the opacity but nothing happen to QWidget.

How to set transparency to child QWidget which derived from parent?

Santosh Reddy
1st March 2017, 11:21
Is it a widget in a container widget ?
or
Is it the top level widget (window) ?

high_flyer
2nd March 2017, 10:30
How to set transparency to child QWidget which derived from parent?
At first I wanted to correct Santosh Reddy since you wrote "child widget" in your subject, but then I saw the statement I quoted which hints to the possibility you are using the word 'child' to describe a sub class - or - you are misusing the word derived?
So at the moment I agree withe Santosh that its not clear what is your setup - could you elaborate a bit more?