Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

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

    General and Desktop
    2
    4
    2026
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      goblincoding last edited by

      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!

      http://www.goblincoding.com

      1 Reply Last reply Reply Quote 0
      • L
        loladiro last edited by

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

        1 Reply Last reply Reply Quote 0
        • G
          goblincoding last edited by

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

          http://www.goblincoding.com

          1 Reply Last reply Reply Quote 0
          • L
            loladiro last edited by

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

            1 Reply Last reply Reply Quote 0
            • First post
              Last post