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

[Reg 5.15 -> 6.1] Not possible to use Loader inside inline component

    XMLWordPrintable

    Details

    • Platform/s:
      All
    • Commits:
      95837745e4 (qt/qtdeclarative/dev) 95837745e4 (qt/tqtc-qtdeclarative/dev) 536d0c8bab (qt/qtdeclarative/6.3) 536d0c8bab (qt/tqtc-qtdeclarative/6.3) 20d53f3059 (qt/tqtc-qtdeclarative/6.2)

      Description

      Surprisingly, simple usage of Loader in declaration of an inline component is not possible and breaks QML.

      First case - Loader as root

      component MyComponent : Loader {
          sourceComponent: Item {}
      }
      

      produces an error

       Cannot assign object of type "Item" to property of type "QQmlComponent*" as the former is neither the same as the latter nor a sub-class of it.
      

      Second case - some nested Loader

      component MyComponent : Item {
          Loader {
              sourceComponent: Item {}
          }
      }
      

      produces error

      Component elements may not contain properties other than id
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              ulherman Ulf Hermann
              Reporter:
              studiosus Vladimir Belyavsky
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes