Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator 18.0 doesn't read typeinfo for C++ classes from module

Qt Creator 18.0 doesn't read typeinfo for C++ classes from module

Scheduled Pinned Locked Moved Qt Creator and other tools
completionqmllsqt creator
1 Posts 1 Posters 127 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SebastianMS Offline
    SebastianMS Offline
    SebastianM
    wrote on last edited by SebastianM
    #1

    Hi,
    I'm working with Qt 6.7 with Qt Creator 18.0.

    I've got 10 modules with C++ classes registered with QML_ELEMENT (sometimes with QML_SINGLETON).

    • Modules are created with qt_add_qml_module.
    • Source for modules are in src/<actions|devices|store>.
    • URI follow core.actions, core.devices, core.store, etc.
    • OUTPUT_DIRECTORY follow "${CMAKE_BINARY_DIR}/core/actions".
    • In CMakeLists.txt in root folder I specified
    set(QML_IMPORT_PATH
        ${CMAKE_CURRENT_SOURCE_DIR}/qml
        ${CMAKE_CURRENT_SOURCE_DIR}/src
        CACHE STRING "" FORCE
    )
    
    • Added -DQT_QML_GENERATE_QMLLS_INI=ON to CMake for configuration
    • At "${CMAKE_BINARY_DIR}/core/actions" there are
      • qmldir (with module, plugin, classname, typeinfo and prefer fields pointing to existing elements)
      • coreActions.qmltypes which contains entries for hpp files with provided properties, methods and signals.
    • Line import core.actions Qt Creator doesn't highlight as faulty.
    • Qt Creator Tools > QML/JS > Reset Code Model and Tools > C++ > Update Pottentialy State Clangd Index Entries called and Qt Creator restarted

    Application compiles and works fine. In GammaRay in Resources panel there're URI for C++ modules with qmldir inside.
    WHY Qt Creator fails to Follow symbol under cursor (F2) or Ctrl-[ for any C++ class used as property type? (PS: At first I couldn't even F2 on DeviceActions {} - but somehow it started working.)

    import core.actions
    
    Item {
        property DeviceActions devActions: DeviceActions {}
    }
    

    Follow up: In Jetbrains CLion and VS Code I can use QML Language Server to support code completion and suggestions.
    Everything is as above. Jump to QML components sources works fine. Jump to C++ classes source fails.
    How can I help QMLLS to provide needed configurations or parameters?

    1 Reply Last reply
    0
    • SebastianMS SebastianM marked this topic as a regular topic on

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved