cneben / QuickQanava

:link: C++17 network / graph visualization library - Qt6 / QML node editor.
http://cneben.github.io/QuickQanava/index.html
Other
1.18k stars 230 forks source link

:dart: Make QuickQanava warning-free with respect to `qmllint` #248

Open emmenlau opened 1 month ago

emmenlau commented 1 month ago

In recent versions of Qt (at least since 6.7.2), the tool qmllint has become much more helpful. We are using it now on a regular basis to validate our QML code.

In this process, I have seen that QuickQanava does not currently work well with qmllint. Just using QuickQanava in a project will trigger a large number of warnings, for example:

[build] Warning: /home/user/Source/qml/PipelineRunnerPage.qml:96:24: Qan.Graph was not found. Did you add all import paths? [import]
[build]                 graph: Qan.Graph {
[build]                        ^^^
[build] Warning: /home/user/Source/qml/PipelineRunnerPage.qml:105:35: Qan.NodeItem was not found. Did you add all import paths? [import]
[build]                     nodeDelegate: Qan.NodeItem {
[build]                                   ^^^
[build] Warning: /home/user/Source/qml/PipelineRunnerPage.qml:125:25: Qan.RectNodeTemplate was not found. Did you add all import paths? [import]
[build]                         Qan.RectNodeTemplate {
[build]                         ^^^
[build] Warning: /home/user/Source/qml/PipelineRunnerPage.qml:105:35: Qan.NodeItem was not found. Did you add all import paths? [import]
[build]                     nodeDelegate: Qan.NodeItem {
[build]                                   ^^^
[build] Warning: /home/user/Source/qml/PipelineRunnerPage.qml:79:13: Qan.GraphView was not found. Did you add all import paths? [import]
[build]             Qan.GraphView {
[build]             ^^^

There are quite a lot more related warnings.

When using modern cmake features on QuickQanava, all the types should be automatically detected and exported with the module. There is no longer a need to maintain manually the qmldir files.

cneben commented 1 month ago

Note for self: BTW, using qmltc (https://doc.qt.io/qt-6/qtqml-qml-type-compiler.html) for node / edge component could be interesting.