Qt Creator 18.0 doesn't read typeinfo for C++ classes from module
Qt Creator and other tools
1
Posts
1
Posters
127
Views
1
Watching
-
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.txtin 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=ONto CMake for configuration - At
"${CMAKE_BINARY_DIR}/core/actions"there areqmldir(with module, plugin, classname, typeinfo and prefer fields pointing to existing elements)coreActions.qmltypeswhich contains entries for hpp files with provided properties, methods and signals.
- Line
import core.actionsQt Creator doesn't highlight as faulty. - Qt Creator
Tools > QML/JS > Reset Code ModelandTools > C++ > Update Pottentialy State Clangd Index Entriescalled 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 toFollow symbol under cursor (F2)orCtrl-[for any C++ class used as property type? (PS: At first I couldn't even F2 onDeviceActions {}- 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? - Modules are created with
-
S SebastianM marked this topic as a regular topic on