diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-25 16:11:53 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-25 18:08:28 +0100 |
| commit | 7bb49eabdf8d86567660c8825892eb323fa6e674 (patch) | |
| tree | bbcfb9f80fa8373dc61e63cafef30e8a664cedea /README.md | |
| parent | 9507f9779809bd077705d1ad54384f714b41c122 (diff) | |
| download | BobinkQtOpcUa-7bb49eabdf8d86567660c8825892eb323fa6e674.tar.gz BobinkQtOpcUa-7bb49eabdf8d86567660c8825892eb323fa6e674.zip | |
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)
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -183,6 +183,29 @@ target_compile_definitions(YourApp PRIVATE QTOPCUA_PLUGIN_PATH="${QTOPCUA_INSTALL_DIR}/plugins") ``` +## Editor setup (QML Language Server) + +The build generates `.qmlls.ini` files so that qmlls can resolve both Qt and local Bobink QML imports. + +**Neovim** — works out of the box if your LSP config picks up qmlls. + +**Qt Creator** — enable the language server under Edit > Preferences > Language Client > QML Language Server. + +**QML formatting** — a `.qmlformat.ini` is included at the project root. `qmlformat` picks it up automatically from the terminal (`qmlformat -i file.qml`). Qt Creator does not respect `.qmlformat.ini` or its own Code Style settings when formatting ([QTCREATORBUG-29668](https://bugreports.qt.io/browse/QTCREATORBUG-29668)) — use the command line instead. + +**Submodule users** — since `QT_QML_GENERATE_QMLLS_INI` and the demo are only enabled for top-level builds, add these to your own project: + +```cmake +# Enable .qmlls.ini generation +set(QT_QML_GENERATE_QMLLS_INI ON CACHE BOOL "") + +# Add the build QML directory so qmlls can resolve the Bobink import +qt_add_qml_module(YourApp + URI YourApp + ... + IMPORT_PATH "${CMAKE_BINARY_DIR}/qml") +``` + ## Project structure ``` |
