PDA

View Full Version : QWidget visibility



DmitryNik
28th October 2011, 20:51
Hello!

Could you, please, tell me, how can be changed the widget opacity SMOOTHLY(using a QTimer, for example), when it has a parent(e.g. QMainWindow instance)?
I tried use setWindowOpacity-method for the widget, but this trick didn't work.

Thank you for answers beforehand.

DmitryNik
29th October 2011, 09:14
Playing with QPalette didn't work. And that is strange. I created my own property(opacity) and just tried to mess with alpha via QPalette-class and QPropertyAnimation.

ChrisW67
31st October 2011, 06:12
Are you painting the widget yourself? Fade-Effects: a Blast from the Past (http://labs.qt.nokia.com/2007/08/21/fade-effects-a-blast-from-the-past/)

DmitryNik
31st October 2011, 07:34
Thank you for your answer.
Yes, kind of.

You see, when the widget has a parent, it will appear on this parent with no chance to change the widget opacity, e.g. to 0.5f. And my guess was: I need to paint it by myself and change the alpha parametr of a qbrush.

By the way, why doesn't work dragMode for QGraphicsView, if eventFilter is installed? For instance I need to trace the mouse pointer position and in the same way I need to move items in the scene and use a rubberBandDrag. If I installed an eventFilter or reimplement the mouse events for QGraphicsView, then dragMode will not work at all. So what I need to do in this case?


____________________________
About the last part: solved. Inheriting and QGraphicsView::mouseMoveEvent(event).