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

Regression: cannot use QML_ANONYMOUS and QML_UNCREATABLE at the same time

    XMLWordPrintable

Details

    • All
    • a60968283 (dev), 2acf4db15 (6.5)

    Description

      In my app I have

      class Foo : public QObject
      {
           Q_OBJECT
           QML_ANONYMOUS
           QML_UNCREATABLE("")
      }
      

      which compiles fine with Qt 6.2.4 up to 6.4.2

      With 6.5.0beta3 however, I get this (output from XCode 14, ios-sim):

      /Users/sandman/Qt/6.5.0/ios/include/QtQmlIntegration/qqmlintegration.h:56:16: note: expanded from macro 'QML_UNCREATABLE'
          enum class QmlIsUncreatable {yes = true}; \
                     ^
      In file included from /Users/sandman/git/brickstore/src/common/script.cpp:9:
      /Users/sandman/git/brickstore/src/common/brickstore_wrapper.h:468:5: note: previous definition is here
          QML_ANONYMOUS
          ^ 

      As both macros try to create QmlIsUncreatable.

      Also the docs for QML_UNCREATABLE (both 6.4 and 6.5) state:

      "Some QML types are implicitly uncreatable, in particular types exposed with QML_ANONYMOUS or namespaces exposed with QML_ELEMENT or QML_NAMED_ELEMENT(). For such types, QML_UNCREATABLE() can be used to provide a custom error message."

      Which IMHO implies that both can be used at the same time perfectly fine.

      Attachments

        For Gerrit Dashboard: QTBUG-111470
        # Subject Branch Project Status CR V

        Activity

          People

            ulherman Ulf Hermann
            rgriebl Robert Griebl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes