Hi All,

I want to create opaque child widget over semi transparent parent widget.

If I so setWindowOpacity(.4) parent become transparent and same is propagated to child, I tired with setstylesheet
Qt Code:
  1. QString qStrStyleSheet(QString(" QDialog {\
  2. background-color: rgba(100,100,100,20%);\
  3. }"));
  4.  
  5. setStyleSheet(qStrStyleSheet);
To copy to clipboard, switch view to plain text mode 

but was not able to draw it properly, what I saw was black parent (opaque).

I also tried using
Qt Code:
  1. setAttribute(Qt::WA_TranslucentBackground, true);
  2. setWindowFlags(Qt::FramelessWindowHint)
To copy to clipboard, switch view to plain text mode 
, this gives exact behavior but parent is transparent, however I want it to be semi-transparent (40%).

I have also tried overwriting paintEvent
Qt Code:
  1. QPalette palette;
  2. palette.setColor(backgroundRole(), QColor(194,194,194,40));
  3. setPalette(palette);
To copy to clipboard, switch view to plain text mode 

After searching in google I came across this link , still it's not working for me.

I am using Qt-4.6 with windows-7

Can anyone help me with this.