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

qmake fails to register C++ namespace in QML in developer build

    XMLWordPrintable

Details

    Description

      The issue can be reproduced with this patch: https://codereview.qt-project.org/c/qt/qtcoap/+/485107, which is an update of the Quick CoAP Multicast Discovery example (so if it's merged - just check the example).

      Switching to the modern type registration, I use

      namespace QCoapForeignNamespace
      {
          Q_NAMESPACE
          QML_FOREIGN_NAMESPACE(QtCoap)
          QML_NAMED_ELEMENT(QtCoap)
      }
      

      to register the QtCoap namespace in QML.
      This works fine with CMake, but qmake generates an incorrect *_qmltyperegistrations.cpp file. Specifically, it just tried to call

      QMetaType::fromType<QtCoap>().id();
      

      to register the namespace, which makes no sense.

      Note: I'm using a developer build of Qt. The problem goes away if I use an installed version of Qt (tried with the 6.6.0 snapshot from the maintenance tool).

       

       

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            ivan.solovev Ivan Solovev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes