Important: Please read the Qt Code of Conduct -

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

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

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

    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?


  • 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