y.s.bisht
10th November 2011, 16:13
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
QString qStrStyleSheet(QString(" QDialog {\
background-color: rgba(100,100,100,20%);\
}"));
setStyleSheet(qStrStyleSheet);
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)
, this gives exact behavior but parent is transparent, however I want it to be semi-transparent (40%).
I have also tried overwriting paintEvent
QPalette palette;
palette.setColor(backgroundRole(), QColor(194,194,194,40));
setPalette(palette);
After searching in google I came across this link (http://gonwan1985.blogspot.com/2009/03/transparency-translucency-in-qt.html?showComment=1268488475782#c129049113326695 0817), still it's not working for me.
I am using Qt-4.6 with windows-7
Can anyone help me with this.
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
QString qStrStyleSheet(QString(" QDialog {\
background-color: rgba(100,100,100,20%);\
}"));
setStyleSheet(qStrStyleSheet);
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)
, this gives exact behavior but parent is transparent, however I want it to be semi-transparent (40%).
I have also tried overwriting paintEvent
QPalette palette;
palette.setColor(backgroundRole(), QColor(194,194,194,40));
setPalette(palette);
After searching in google I came across this link (http://gonwan1985.blogspot.com/2009/03/transparency-translucency-in-qt.html?showComment=1268488475782#c129049113326695 0817), still it's not working for me.
I am using Qt-4.6 with windows-7
Can anyone help me with this.