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

Using States to set Loader sourceComponent leads to warning on application exit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.13.2
    • None

      In our application, we're using States in a Loader.

      This leads to the engine complaining on exit:

       "There are still \"1\" items in the process of being created at engine destruction."
      

      The QML code to reproduce this can be boiled down to:

      import QtQuick 2.12
      import QtQuick.Controls 2.12
      
      ApplicationWindow {
          visible: true
      
          property bool stateActive: true
      
          Loader {
              id: loader
              asynchronous: true
              states: [
                  State {
                      when: stateActive
                      PropertyChanges { target: loader; sourceComponent: mainComponent }
                  }
              ]
          }
          Component {
              id: mainComponent
              Rectangle {
      
              }
          }
      }
      

      The Error message itself isn't a big deal, but replacing those states with something else, or disabling the 'asynchronous' property lead to more strange errors appearing elsewhere. So i wanted to dig deeper and see if the answer to this could tell us something more.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            strfry Jonathan Sieber
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes