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
)
void NorwegianWoodStyle::polish(QWidget *widget)
To copy to clipboard, switch view to plain text mode
method i have added two lines of code:-
if(widget->isWindow())
{
widget->setWindowFlags( Qt::FramelessWindowHint );
widget->setAttribute( Qt::WA_TranslucentBackground );
}
if(widget->isWindow())
{
widget->setWindowFlags( Qt::FramelessWindowHint );
widget->setAttribute( Qt::WA_TranslucentBackground );
}
To copy to clipboard, switch view to plain text mode
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.
Qt5_7_output.PNG
Qt_4_8_Output.PNG
Could you please tell me if this is Qt bug and is there any alternative resolution to this problem.
Bookmarks