PDA

View Full Version : Cannot make transparent (translucent) background using Qt styles



sonulohani
10th December 2016, 10:13
I have used the Qt widgets->styles example to test this functionality. The only change i have made is that in
void NorwegianWoodStyle::polish(QWidget *widget) method i have added two lines of code:-


if(widget->isWindow())
{
widget->setWindowFlags( Qt::FramelessWindowHint );
widget->setAttribute( Qt::WA_TranslucentBackground );
}

However the output is not what i have expected. its showing output with black background. However when building the same example with Qt 4.8 I am able to see the transparent background. The following screenshots in the attachment section will help you more in understanding the problem.
12244
12245

Could you please tell me if this is Qt bug and is there any alternative resolution to this problem.