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

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

XMLWordPrintable

    • All
    • 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)

      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
      

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes