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
background-color: rgba(100,100,100,20%);\
}"));
setStyleSheet(qStrStyleSheet);
QString qStrStyleSheet(QString(" QDialog {\
background-color: rgba(100,100,100,20%);\
}"));
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
setAttribute(Qt::WA_TranslucentBackground, true);
setWindowFlags(Qt::FramelessWindowHint)
setAttribute(Qt::WA_TranslucentBackground, true);
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
palette.
setColor(backgroundRole
(),
QColor(194,
194,
194,
40));
setPalette(palette);
QPalette palette;
palette.setColor(backgroundRole(), QColor(194,194,194,40));
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.
Bookmarks