Results 1 to 4 of 4

Thread: Qt Animation with show() cause first layout update

  1. #1
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Unhappy Qt Animation with show() cause first layout update

    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.

    Qt Code:
    1. if (! m_findReplaceBar->isVisible()) {
    2. m_findReplaceBar->show();
    3. QPropertyAnimation *a = m_findReplaceBar->m_animator;
    4.  
    5. if (a) {
    6. QRect rect = m_findReplaceBar->geometry();
    7. a-> setEndValue(rect);
    8. rect.setTop(rect.bottom());
    9. a->setStartValue(rect);
    10. a->start();
    11. }
    12. }
    To copy to clipboard, switch view to plain text mode 

    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.

    Unbenannt.jpg

    well the example is above. it loooooks so ugly

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt Animation with show() cause first layout update

    Maybe be animate the toolbar's height as well?

    Cheers,
    _

  3. #3
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Qt Animation with show() cause first layout update

    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.

  4. #4
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Qt Animation with show() cause first layout update

    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.

Similar Threads

  1. layout update problem
    By tuli in forum Qt Programming
    Replies: 8
    Last Post: 15th April 2013, 17:58
  2. QPropertyAnimation show the Widget before start the animation
    By rperezalejo in forum Qt Programming
    Replies: 0
    Last Post: 13th October 2011, 02:26
  3. Slide show using QProperty animation
    By mvbhavsar in forum Newbie
    Replies: 0
    Last Post: 10th August 2011, 10:24
  4. Replies: 1
    Last Post: 20th July 2011, 08:27
  5. Show/Hide height animation with SetFixedSize
    By mnunberg in forum Qt Programming
    Replies: 7
    Last Post: 24th November 2010, 11:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.