PDA

View Full Version : Qt Animation with show() cause first layout update



cic
16th January 2014, 10:30
Hello all,

i have inserted a second QToolBar at the bottom of QMainWindow,

this toolbar in my desire should be shown/hided-enabled by user.
like a search bar in webbrowser.



if (! m_findReplaceBar->isVisible()) {
m_findReplaceBar->show();
QPropertyAnimation *a = m_findReplaceBar->m_animator;

if (a) {
QRect rect = m_findReplaceBar->geometry();
a-> setEndValue(rect);
rect.setTop(rect.bottom());
a->setStartValue(rect);
a->start();
}
}


i found it after calling show() for the toolbar, the space which for the full rage of toolbar is preserved while not updated together with
the toolbar's animation.

9936

well the example is above. it loooooks so ugly

anda_skoa
16th January 2014, 11:53
Maybe be animate the toolbar's height as well?

Cheers,
_

cic
16th January 2014, 13:53
Hi anda_skoa,

it didnt work. still left an empty space for toolbar before animation finished.
is there any way to disable mainwindow layout update before animation finishes?

im also curious how qt does in similar case.

cic
17th January 2014, 11:15
Hope the solution can help anyone with the same issue above.

instead of geometry, animate the maximumSize of the toolbar because the mainwindow layout manage the geometry of its widget.