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

QML Loader Content Loaded Twice Within State Transition

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.8
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Ubuntu 16.04 LTS 64 bit VM, Windows 10 64 bit host
      Desktop GCC 64bit
    • Platform/s:
      Linux/X11

      Description

      When controlling the timing of the Loader's active property change via a State Transition, the Loader's content is loaded twice.

      We have a usecase where it is important to control when a Loader's active property is set to true when raising a popup. This is for timing changes with a fade animation and certain other animations, binding changes, and logic.

      We are observing this issue where the content of the Loader is being loaded twice.

      In the attached example, I've included two basic "Popup" files, one which exhibits the bug, and another which does not. The issue seems to relate to expression complexity in other PropertyChanges elements' bindings.

      Here is some sample output:

      qml: Popup active: true
      qml: Popup new state: active
      qml: Popup contentLoader loaded
      qml: Popup contentLoader active changed to: true
      
      qml: DoubleLoadingPopup active: true
      qml: DoubleLoadingPopup new state: active
      qml: DoubleLoadingPopup contentLoader loaded
      qml: DoubleLoadingPopup contentLoader active changed to: true
      qml: DoubleLoadingPopup contentLoader active changed to: false
      qml: DoubleLoadingPopup contentLoader loaded
      qml: DoubleLoadingPopup contentLoader active changed to: true
      

      This difference between one popup and the next is observed in this case by changing the PropertyChanges binding preceding the Loader active PropertyChanges element from

      100

      to:

       {return 100} 

      However any number of other changes can be made to reproduce the issue.

      With a more complex example including more PropertyChanges, more States, etc, this issue is nigh on guaranteed to occur.

        Attachments

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

          Activity

            People

            Assignee:
            qtqmlteam Qt Qml Team User
            Reporter:
            dchamberlain David Chamberlain
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes