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

Make it easier to attach a component loading to a state

    XMLWordPrintable

Details

    Description

      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 { ... }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jpetrell Joona Petrell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes