KDAB / cxx-qt

Safe interop between Rust and Qt
https://kdab.github.io/cxx-qt/book/
964 stars 66 forks source link

cxx-qt-build: Export .qmltypes and qmldir for use with external tooling #982

Open LeonMatthesKDAB opened 2 weeks ago

LeonMatthesKDAB commented 2 weeks ago

This should improve support for qmllint and qmlls

Currently we get this ouput from qmllint after this change:

examples/qml_features/qml on  963-custom-cmake [$!?] took 1m10s
❯ qmllint-qt6 -i ../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/qmldir pages/PropertiesPage.qml
Warning: pages/PropertiesPage.qml: Warnings occurred while importing base modules: [import]
---
Warning: ../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:15:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:25:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:81:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:96:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:121:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:140:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:155:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:175:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:234:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:252:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:283:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:308:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:321:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:332:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:351:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:376:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes:407:37: Meta object revision and export version differ.
Revision 0 corresponds to version 0.0; it should be 1.0.
 [import]
Warning: Found deprecated dependency specifications in ../../../build/examples/qml_features/cxxqt/plugins/com_kdab_cxx_qt_demo/plugin.qmltypes.Specify dependencies in qmldir and use qmltyperegistrar to generate qmltypes files without dependencies. [import]
---

Warning: pages/PropertiesPage.qml:36:5: Cannot assign to default property of incompatible type [incompatible-type]
    RustProperties {

Depends on #978

ahayzen-kdab commented 2 weeks ago

For

Warning: pages/PropertiesPage.qml:36:5: Cannot assign to default property of incompatible type [incompatible-type]
    RustProperties {

we might need to change that code to be

readonly property RustProperties rustProperties: RustProperties {}

instead of

RustProperties {
  id: rustProperties
}

But there are likely other places that complain about this too.

For the other issues looks maybe related to missing setting a version in the plugin ?