From 7bb49eabdf8d86567660c8825892eb323fa6e674 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Wed, 25 Feb 2026 16:11:53 +0100 Subject: Add .qmlformat.ini, qmlls support, and format QML files - Enable QT_QML_GENERATE_QMLLS_INI for QML Language Server support - Add IMPORT_PATH to demo's qt_add_qml_module so .qmlls.ini includes the local build QML directory alongside the Qt system path - Add editor setup section to README with qmlls and qmlformat guidance - Add QML formatting section to French guide - Reformat demo QML files with .qmlformat.ini (line wrapping at 80 cols) --- CMakeLists.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 51b90e8..0be515b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,14 +10,15 @@ endif() # Build external dependencies (open62541, qtopcua) if not already built include(cmake/BuildDeps.cmake) -# Point CMake directly at the locally-built QtOpcUa packages. -# Qt6Config.cmake uses NO_DEFAULT_PATH when searching for components, so -# QT_ADDITIONAL_PACKAGES_PREFIX_PATH should work but is fragile in practice -# (Qt Creator can interfere). Setting _DIR is always checked first. +# Point CMake directly at the locally-built QtOpcUa packages. Qt6Config.cmake +# uses NO_DEFAULT_PATH when searching for components, so +# QT_ADDITIONAL_PACKAGES_PREFIX_PATH should work but is fragile in practice (Qt +# Creator can interfere). Setting _DIR is always checked first. set(Qt6OpcUa_DIR "${QTOPCUA_INSTALL_DIR}/lib/cmake/Qt6OpcUa") set(Qt6OpcUaPrivate_DIR "${QTOPCUA_INSTALL_DIR}/lib/cmake/Qt6OpcUaPrivate") set(Qt6OpcUaTools_DIR "${QTOPCUA_INSTALL_DIR}/lib/cmake/Qt6OpcUaTools") -set(Qt6DeclarativeOpcua_DIR "${QTOPCUA_INSTALL_DIR}/lib/cmake/Qt6DeclarativeOpcua") +set(Qt6DeclarativeOpcua_DIR + "${QTOPCUA_INSTALL_DIR}/lib/cmake/Qt6DeclarativeOpcua") list(PREPEND CMAKE_PREFIX_PATH "${OPEN62541_INSTALL_DIR}") find_package(Qt6 6.10.2 REQUIRED COMPONENTS Core Qml Quick OpcUa) @@ -29,10 +30,10 @@ if(PROJECT_IS_TOP_LEVEL) set(QML_IMPORT_PATH "${CMAKE_CURRENT_BINARY_DIR}/qml" CACHE STRING "Path to locally built qml") - # Generate .qmlls.ini for QML Language Server. Useful once QtOpcUa is installed - # globally (qt-cmake --install build/deps/qtopcua-build) so qmlls can resolve - # all Qt QML imports without extra importPaths. set(QT_QML_GENERATE_QMLLS_INI ON - # CACHE BOOL "") + # Generate .qmlls.ini for QML Language Server + set(QT_QML_GENERATE_QMLLS_INI + ON + CACHE BOOL "") # Ensure the local QtOpcUa and open62541 libs are findable at runtime (needed # because the Qt plugin loader dlopen's the open62541 backend). -- cgit v1.2.3