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

States cause double creation of loader item on initialization.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 6.4.2
    • None
    • Windows

      The attached example sets the sourceComponent through the states property in a Loader. This component is created twice on initialization and will never be destructed.
      It is also active and could receive signals etc.

      The behavior could be examined by just loading main.qml.
      There you get the log message from line 52 twice. You also get two messages by pressing the triggerSomething button which emits a signal that the component consumes(plots a message).

      This behavior is tricky and could be fixed by activiting the Loader in Component.onCompleted.

        1. main.qml
          2 kB
          Christian von Wascinski
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtqmlteam Qt Qml Team User
            cherold Christian von Wascinski
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes