Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-15750

Layout jumps when showing and hiding child widgets before showing the window

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.6.3, 4.7.1
    • Widgets: Layout
    • None

    Description

      In the constructor of a window W1, the following things are happening:

      • show() is called explicitely on a child widget W2 (e.g. due to QStackedWidget::setCurrentIndex(0))
      • an indirect child of W2 (let's call it W3) is being hidden
        and then the window is shown.

      In this situation, the following bug happens: the window first shows with the initial layout (calculated when W3 was still being visible, even though it's indeed hidden) and then the layout is recalculated and everything moves around to the final position.
      If painting is requested by the windowing system in between these two layoutings, the window contents will appear to "jump".

      The jumping window contents look a bit unprofessional and slow, and annoyed the customer I'm visiting this week, so they asked me to fix it

      I'm attaching here the complete visual testcase for the issue (which uses QStackedWidget, which is the one calling show() on W2), then I'll make a merge request with the much simpler unittest and the suggested fix.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            dfaure David Faure (Private)
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes