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

qmltyperegistrar does not update qmltypes when C++ changes (CMake)

    XMLWordPrintable

Details

    Description

      You can reproduce this on tst_qmltyperegistrar:

      1. Build tst_qmltyperegistrar (fresh build works fine, so this is needed)
      2. Go to qtdeclarative/tests/auto/qml/qmltyperegistrar/hppheader.hpp
      3. Add new property to HppClass, say:

      Q_PROPERTY(int invisibleProperty READ invisibleProperty)
      // boilerplate reader and member variable
      

      4. Rebuild tst_qmltyperegistrar

      moc_hppheader.cpp.json under <build path>/tst_qmltyperegistrar_autogen/ (which I guess is used to generate the tst_qmltyperegistrar.qmltypes) is updated correctly and contains new property entry for "inivisibleProperty".

      tst_qmltyperegistrar.qmltypes, however, is not updated and there's no "invisibleProperty".

      Looks like we don't have a proper CMake dependency between MOC's json and qmltyperegistrar/qmltypes, so whenever the json changes, qmltypes becomes outdated. This is super confusing when e.g. you add new property to C++ class then use that in QML file and running qmllint returns "no property foobar" (when it should actually be correctly registered).

      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
            agolubev Andrei Golubev
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes