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

Make it easier to attach a component loading to a state

XMLWordPrintable

      Currently you have to use Loader (or worse, Qt.createComponent function) to initialize new content in a state change:

      Loader { id: thumbnailLoader }
      Component {
          id: thumbComponent
          Image {
              MouseArea { ... }
              Row { ... }
          }
      }
      states: State {
          when: "expanded"
          PropertyChanges {
              target: thumbnailLoader
              sourceComponent: thumbComponent
          }
      }
      

      Simpler syntax (that would also save the construction and geometry handling of the Loader item) could be obtained by introducing new state operation element called ChildCreate that would be responsible of the life time and parenting of the constructed child object:

      states: State {
          when: "expanded"
          ChildCreate {
              parent: window
              Image {
                  MouseArea { ... }
                  Row { ... }
              }
          }
      }
      

        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
            jpetrell Joona Petrell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes