[SOLVED] Eliminating main window transition (resize) "jump"



  • Consider the following snippet (connected to a button->clicked() for example)

    @void MainWindow::toggleWidget()
    {
    if(widget->isVisible()) {
    widget->hide();
    //...do something else also ...
    } else {
    widget->show();
    //...do something else also ...
    }//end if
    }//toggleWidget@

    The transition from hidden to shown is nice and smooth as the main window adjusts its size to accommodate the widget. However, the transition from shown to hidden makes the main window "jump". I understand why this happens (the main window's repainted to accommodate the change as it returns to its original size), but would like to know if there is a way to minimise this effect or eliminate it altogether?

    Thanks!



  • What would you want to happen instead?
    Maybe a QSpacerItem can help you.



  • Thanks a lot! That did exactly what I wanted. So simple, so perfect, pure zen :)



  • Glad I could help, also could you add [Solved] in front of the title of this thread (by editing the first post)?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.