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

qmltyperegistrar warns for qt classes not found (qmllint)

XMLWordPrintable

    • macOS

      Description

      qmltyperegistrar warns about missing Qt base types not found such as QObject:

      Automatic QML type registration for target mymodule
      Warning: ClassA.h:6: QObject is used as base type but cannot be found.

      This issue can be reproduced either by using the qt_add_qml_module() cmake function or running the qmltyperegistrar executable in qt declarative.

      Reproduction

      Please find attached a minimal code to reproduce it using cmake and one registered class. Run:

      ./configure
      cmake --build build --target mymodule_qmltyperegistration --verbose

      Note: the setup is using conan, so make sure to have qt/6.10.0@local/test built

      Additional details 

      • This warning didn't exist in Qt 6.5.0. 
      • After building and running the tool in debug mode, I've found out that the warning comes from https://github.com/qt/qtdeclarative/blob/dev/src/qmltyperegistrar/qmetatypesjsonprocessor.cpp#L544
      • The tools warns only once when using qt_add_qml_module(), change the name of class to make it appear again. Running the tool from qt declarative always gives warning.
      • Having this issue in a larger, corporate, project gives more warnings such as: 
        QAbstractListModel, QAbstractItemModel, QQuickImageProvider, QSortFilterProxyModel, Qt3DCore::QEntity, QQuickItem

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

            qtqmlteam Qt Qml Team User
            david.queruel.cox David Queruel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes