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

[QML] Compiler complains about namespaced QML_ELEMENTS - sometimes

    XMLWordPrintable

Details

    • 87e9ea9efa (qt/qtdeclarative/dev) 87e9ea9efa (qt/tqtc-qtdeclarative/dev) 0f4f59a1f7 (qt/qtdeclarative/6.4) 0f4f59a1f7 (qt/tqtc-qtdeclarative/6.4)

    Description

      Compiling the attached example spits out these messages:

      Error: main.qml: Object type moo::ShareMe is not derived from QObject or QQmlComponent
      Error: main.qml: Object type moo::ShareMe is not derived from QObject or QQmlComponent
      Error: main.qml: Object type moo::ShareMe is not derived from QObject or QQmlComponent
      Error: main.qml:11:19: Could not compile binding for text: Cannot generate efficient code for non-QObject singleton type
              text: Moo.ShareMe.foo
                        ^^^^^^^

      For the small example, the messages go away, if you replace

      class ShareMe : public ShareBase {
      

      by

      class ShareMe : public moo::ShareBase {
      

      .

      BUT: I've local code which is fully qualified and still shows that error. I tried for half an hour to find a way to reproduce it with no success. The code layout boils down to more or less the same structure. So - huh? Any ideas on that one?

      Additionally the error message lies - it is indirectly derived from QObject.

      Attachments

        1. frickler.tgz
          2 kB
        2. importer.tgz
          1 kB
        For Gerrit Dashboard: QTBUG-105254
        # Subject Branch Project Status CR V

        Activity

          People

            ulherman Ulf Hermann
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes