QWidget with parent fully transparent
Hello!
I’m trying to change a qwidget opacity, when it has a parent. As I found out the setWindowOpacity is working only for a window without parent. I tried to reimplement paintEvent for the widget. But in this case I changed only widget’s opacity(made its background a bit transparant), not its elements. The question is: what I need to reimplement in case I want to change widget’s opacity with its elements?
Thank you for your answers beforehand.
8 replies
when a widget has parent then it has no background except when it opened window like. other states you may use a label as your background and objects opacity can be changed via style or opacity property.
but if it`s window like,what`s the reason to give it a parent? you can already show a widget with modal flag or if you need to have access to parent window just keep the parent widget on another pointer.
Hello!The question is: what I need to reimplement in case I want to change widget’s opacity with its elements?
And
- QGraphicsOpacityEffect
can be used to achive this.
But from this wiki page:
http://developer.qt.nokia.com/wiki/Qt_Modules_Maturity_Level
We can see taht:
- Graphics Effects
- State: Deprecated
- Reasoning: flawed design, we don’t recommend taking maintainership of this code.
But from this wiki page:
http://developer.qt.nokia.com/wiki/Qt_Modules_Maturity_LevelWe can see taht:
@
Graphics Effects
State: Deprecated
Reasoning: flawed design, we don’t recommend taking maintainership of this code.
@
Thank you for answer.
I guess they suppose to introduce something new in nearest future. I’m not sure=) But it seems so.
You must log in to post a reply. Not a member yet? Register here!




