Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Eliminating main window transition (resize) "jump"
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.3k Views
  • 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 Offline
    G Offline
    goblincoding
    wrote on last edited by
    #1

    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
    0
    • L Offline
      L Offline
      loladiro
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goblincoding
        wrote on last edited by
        #3

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

        http://www.goblincoding.com

        1 Reply Last reply
        0
        • L Offline
          L Offline
          loladiro
          wrote on last edited by
          #4

          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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved