2 Attachment(s)
resizeEvent destroy my QPropertyAnimation
Hi, i am new user and my english is not a best so please for your understanding ;)
I have a few QToolButton in QToolBar which animates with QPropertAnimation. Something like this
Code:
animation_enabled->setTargetObject( button );
animation_enabled->setPropertyName( "pos" );
animation_enabled->setDuration( 100 );
animation_enabled
->setEndValue
( QPoint( button
->pos
().
x(), animation_pos_end
) );
animation_enabled->start();
the problem is that when the animation is running and i change size of the main window my animation changing positions. Why it happens and what i am doing wrong?
Attachment 9993
Attachment 9994
Re: resizeEvent destroy my QPropertyAnimation
The resize causes a re-layouting of the window and most likely also of the toolbar, which potentially modifies the positions and sizes of the widgets inside the layouts.
You probably have to recalculate the animation values based on the new base values.
Cheers,
_
Re: resizeEvent destroy my QPropertyAnimation
Thanks for reply, you were right ;)
The problem was that the QToolBar inside keept items in layout and when i resize MainWindow then layout inside QToolBar also resize. I solve this problem trought placement items in widget, set minimumSize() and add this widget to QToolBar.
Thanks again ;)