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

Inconsistencies between in-file and out-of-file Components

    XMLWordPrintable

Details

    Description

      From the documentation for the Component element:

      The Component element allows defining components within a QML file. This can be useful for reusing a small component within a single QML file, or for defining a component that logically belongs with the file containing it.

      However, Components embedded in an Item have different semantics from those coming from external files:

      • Embedded components don't define a type, instead their use requires a Loader element. This feels quite unnatural and prevents setting properties directly.
        Why does a component defined in the current file have to be "loaded" while external ones be used directly?
      • Components defined in external files require trivial wrappers to be used as delegates in ListViews. Why can't a type be used directly as a delegate? If absolutely necessary, the trivial wrapper could be created implicitly.

      I think sorting out these differences makes for a more useful more pleasurable declarative language

      Attachments

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

        Activity

          People

            aakenned Aaron Kennedy
            biochimia João Abecasis
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes