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

qt_generate_foreign_qml_types fails with Q_ENUM_NS

    XMLWordPrintable

Details

    • f080d0309 (dev), fa081b89f (dev), 80fa9f25b (6.7), 4b1704b8e (6.7), 4c2c0e4bc (6.6), 4be7779de (6.6), fd4f83c4c (tqtc/lts-6.5), ae8b1967f (tqtc/lts-6.5)

    Description

      I created a little example (with a lot of unused stuff) to understand qmltypes generations for enumeration.

      I get the following error

      [22/40] Automatic QML type registration for target ui_qml
      Warning: Refusing to generate non-lowercase name "Flupp" for unknown foreign type
      
      [27/40] Building CXX object CMakeFiles/ui_qml.dir/ui_base_ui_qml.cpp.o
      FAILED: CMakeFiles/ui_qml.dir/ui_base_ui_qml.cpp.o 
      /usr/bin/c++ -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -I/tmp/p -I/home/andre/hg/QmlDummy -I/tmp/p/ui_qml_autogen/include -I/usr/include/qt6/QtQml/6.6.2 -I/usr/include/qt6/QtQml/6.6.2/QtQml -I/usr/include/qt6/QtCore/6.6.2 -I/usr/include/qt6/QtCore/6.6.2/QtCore -isystem /usr/include/qt6/QtCore -isystem /usr/include/qt6 -isystem /usr/lib/qt6/mkspecs/linux-g++ -isystem /usr/include/qt6/QtQml -isystem /usr/include/qt6/QtQmlIntegration -isystem /usr/include/qt6/QtNetwork -mno-direct-extern-access -MD -MT CMakeFiles/ui_qml.dir/ui_base_ui_qml.cpp.o -MF CMakeFiles/ui_qml.dir/ui_base_ui_qml.cpp.o.d -o CMakeFiles/ui_qml.dir/ui_base_ui_qml.cpp.o -c /tmp/p/ui_base_ui_qml.cpp
      In file included from /usr/include/qt6/QtQml/qqml.h:9,
                       from /tmp/p/ui_base_ui_qml.h:3,
                       from /tmp/p/ui_base_ui_qml.cpp:1:
      /tmp/p/ui_base_ui_qml.h:9:17: error: ‘A’ does not name a type
          9 |     QML_FOREIGN(A)
            |                 ^
      [28/40] Building CXX object CMakeFiles/ui_qml.dir/ui_qml_qmltyperegistrations.cpp.o
      FAILED: CMakeFiles/ui_qml.dir/ui_qml_qmltyperegistrations.cpp.o 
      /usr/bin/c++ -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -I/tmp/p -I/home/andre/hg/QmlDummy -I/tmp/p/ui_qml_autogen/include -I/usr/include/qt6/QtQml/6.6.2 -I/usr/include/qt6/QtQml/6.6.2/QtQml -I/usr/include/qt6/QtCore/6.6.2 -I/usr/include/qt6/QtCore/6.6.2/QtCore -isystem /usr/include/qt6/QtCore -isystem /usr/include/qt6 -isystem /usr/lib/qt6/mkspecs/linux-g++ -isystem /usr/include/qt6/QtQml -isystem /usr/include/qt6/QtQmlIntegration -isystem /usr/include/qt6/QtNetwork -mno-direct-extern-access -MD -MT CMakeFiles/ui_qml.dir/ui_qml_qmltyperegistrations.cpp.o -MF CMakeFiles/ui_qml.dir/ui_qml_qmltyperegistrations.cpp.o.d -o CMakeFiles/ui_qml.dir/ui_qml_qmltyperegistrations.cpp.o -c /tmp/p/ui_qml_qmltyperegistrations.cpp
      In file included from /usr/include/qt6/QtQml/qqml.h:9,
                       from /tmp/p/ui_qml_qmltyperegistrations.cpp:7:
      /tmp/p/ui_base_ui_qml.h:9:17: error: ‘A’ does not name a type
          9 |     QML_FOREIGN(A)
            |                 ^
      [30/40] Building CXX object CMakeFiles/ui_qmlplugin.dir/ui_qmlplugin_StuffPlugin.cpp.o
      ninja: build stopped: subcommand failed.
      

      If I move the example enumeration from "base_enum.h" to "qml.h" and remove "qt_generate_foreign_qml_types" from CMakeLists.txt it works without problems.

      Even the warning "Refusing to generate non-lowercase name" does not happen.

      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
              misery André Klitzing
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews