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

Document the need to qt_extract_metatypes or qt_add_library for external libraries exposed in QML modules

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • 6.7.2
    • QML: Tooling
    • None

    Description

      I have two classes: ClassA, a QML module defined with the QML_ELEMENT macro, and ClassB, a Qt object class within a separate DLL library using the Q_OBJECT macro.

      When inheritting ClassA from ClassB, a warning is generated: "Warning: ClassA.h: ClassB is used but cannot be found." The warning does not impede the execution of the program.

      My build system is CMake and Ninja.

      Note that the warning is only issued during a clean build!

      See attached demo project.

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              warindy yi wang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes