I have used the Qt widgets->styles example to test this functionality. The only change i have made is that in
Qt Code:
  1. void NorwegianWoodStyle::polish(QWidget *widget)
To copy to clipboard, switch view to plain text mode 
method i have added two lines of code:-
Qt Code:
  1. if(widget->isWindow())
  2. {
  3. widget->setWindowFlags( Qt::FramelessWindowHint );
  4. widget->setAttribute( Qt::WA_TranslucentBackground );
  5. }
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.