├── .clang-format ├── .clangd ├── .github ├── dependabot.yml └── workflows │ ├── book.yml │ ├── github-cxx-qt-tests.yml │ └── manual-book.yml ├── .gitignore ├── .markdownlint.jsonc ├── CHANGELOG.md ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CODE_OF_CONDUCT.md.license ├── Cargo.lock ├── Cargo.lock.license ├── Cargo.toml ├── LICENSES ├── Apache-2.0.txt ├── BSD-3-Clause.txt ├── CC-BY-4.0.txt ├── LicenseRef-KDABProprietary.txt ├── LicenseRef-QtProprietary.txt └── MIT.txt ├── README.md ├── book ├── .gitignore ├── .markdownlint.jsonc ├── CMakeLists.txt ├── book.toml └── src │ ├── SUMMARY.md │ ├── bridge │ ├── attributes.md │ ├── extern_cppqt.md │ ├── extern_rustqt.md │ ├── index.md │ ├── shared_types.md │ └── traits.md │ ├── common-issues.md │ ├── concepts │ ├── build_systems.md │ ├── casting.md │ ├── generated_qobject.md │ ├── index.md │ ├── inheritance.md │ ├── instantiating_in_rust.md │ ├── nested_objects.md │ ├── types.md │ └── wasm-builds.md │ ├── getting-started │ ├── 1-qobjects-in-rust.md │ ├── 2-our-first-cxx-qt-module.md │ ├── 3-qml-gui.md │ ├── 4-cargo-executable.md │ ├── 5-cmake-integration.md │ └── index.md │ ├── images │ ├── export_images.sh │ ├── overview_abstract.dot │ ├── overview_abstract.svg │ └── overview_abstract.svg.license │ ├── index.md │ └── internals │ ├── build-system.md │ ├── crate-organization.md │ └── index.md ├── clippy.toml ├── cmake └── CompilerCaching.cmake ├── codecov.yml ├── crates ├── cxx-qt-build │ ├── Cargo.toml │ └── src │ │ ├── cfg_evaluator.rs │ │ ├── dependencies.rs │ │ ├── diagnostics.rs │ │ ├── dir.rs │ │ ├── lib.rs │ │ ├── opts.rs │ │ └── qml_modules.rs ├── cxx-qt-gen │ ├── Cargo.toml │ ├── src │ │ ├── generator │ │ │ ├── cfg.rs │ │ │ ├── cpp │ │ │ │ ├── constructor.rs │ │ │ │ ├── cxxqttype.rs │ │ │ │ ├── externcxxqt.rs │ │ │ │ ├── fragment.rs │ │ │ │ ├── inherit.rs │ │ │ │ ├── method.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── property │ │ │ │ │ ├── getter.rs │ │ │ │ │ ├── meta.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── setter.rs │ │ │ │ │ └── signal.rs │ │ │ │ ├── qenum.rs │ │ │ │ ├── qnamespace.rs │ │ │ │ ├── qobject.rs │ │ │ │ ├── signal.rs │ │ │ │ ├── threading.rs │ │ │ │ └── utils.rs │ │ │ ├── mod.rs │ │ │ ├── naming │ │ │ │ ├── mod.rs │ │ │ │ ├── namespace.rs │ │ │ │ ├── property.rs │ │ │ │ ├── qobject.rs │ │ │ │ └── signals.rs │ │ │ ├── rust │ │ │ │ ├── constructor.rs │ │ │ │ ├── cxxqttype.rs │ │ │ │ ├── externcxxqt.rs │ │ │ │ ├── fragment.rs │ │ │ │ ├── inherit.rs │ │ │ │ ├── method.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── property │ │ │ │ │ ├── getter.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── setter.rs │ │ │ │ │ └── signal.rs │ │ │ │ ├── qenum.rs │ │ │ │ ├── qobject.rs │ │ │ │ ├── signals.rs │ │ │ │ └── threading.rs │ │ │ └── structuring │ │ │ │ ├── mod.rs │ │ │ │ └── qobject.rs │ │ ├── lib.rs │ │ ├── naming │ │ │ ├── cpp.rs │ │ │ ├── mod.rs │ │ │ ├── name.rs │ │ │ ├── rust.rs │ │ │ └── type_names.rs │ │ ├── parser │ │ │ ├── constructor.rs │ │ │ ├── cxxqtdata.rs │ │ │ ├── externcxxqt.rs │ │ │ ├── externqobject.rs │ │ │ ├── externrustqt.rs │ │ │ ├── inherit.rs │ │ │ ├── method.rs │ │ │ ├── mod.rs │ │ │ ├── parameter.rs │ │ │ ├── property.rs │ │ │ ├── qenum.rs │ │ │ ├── qnamespace.rs │ │ │ ├── qobject.rs │ │ │ ├── signals.rs │ │ │ └── trait_impl.rs │ │ ├── shorthand │ │ │ ├── mod.rs │ │ │ └── self_inlining.rs │ │ ├── syntax │ │ │ ├── attribute.rs │ │ │ ├── cfg.rs │ │ │ ├── expr.rs │ │ │ ├── foreignmod.rs │ │ │ ├── lifetimes.rs │ │ │ ├── mod.rs │ │ │ ├── path.rs │ │ │ ├── qtfile.rs │ │ │ ├── qtitem.rs │ │ │ └── types.rs │ │ └── writer │ │ │ ├── cpp │ │ │ ├── header.rs │ │ │ ├── mod.rs │ │ │ └── source.rs │ │ │ ├── mod.rs │ │ │ └── rust │ │ │ └── mod.rs │ ├── test_inputs │ │ ├── cfgs.rs │ │ ├── cfgs.rs.license │ │ ├── inheritance.rs │ │ ├── inheritance.rs.license │ │ ├── invokables.rs │ │ ├── invokables.rs.license │ │ ├── passthrough_and_naming.rs │ │ ├── passthrough_and_naming.rs.license │ │ ├── properties.rs │ │ ├── properties.rs.license │ │ ├── qenum.rs │ │ ├── qenum.rs.license │ │ ├── shebang.rs │ │ ├── shebang.rs.license │ │ ├── signals.rs │ │ └── signals.rs.license │ ├── test_outputs │ │ ├── cfgs.cpp │ │ ├── cfgs.cpp.license │ │ ├── cfgs.h │ │ ├── cfgs.h.license │ │ ├── cfgs.rs │ │ ├── cfgs.rs.license │ │ ├── inheritance.cpp │ │ ├── inheritance.cpp.license │ │ ├── inheritance.h │ │ ├── inheritance.h.license │ │ ├── inheritance.rs │ │ ├── inheritance.rs.license │ │ ├── invokables.cpp │ │ ├── invokables.cpp.license │ │ ├── invokables.h │ │ ├── invokables.h.license │ │ ├── invokables.rs │ │ ├── invokables.rs.license │ │ ├── passthrough_and_naming.cpp │ │ ├── passthrough_and_naming.cpp.license │ │ ├── passthrough_and_naming.h │ │ ├── passthrough_and_naming.h.license │ │ ├── passthrough_and_naming.rs │ │ ├── passthrough_and_naming.rs.license │ │ ├── properties.cpp │ │ ├── properties.cpp.license │ │ ├── properties.h │ │ ├── properties.h.license │ │ ├── properties.rs │ │ ├── properties.rs.license │ │ ├── qenum.cpp │ │ ├── qenum.cpp.license │ │ ├── qenum.h │ │ ├── qenum.h.license │ │ ├── qenum.rs │ │ ├── qenum.rs.license │ │ ├── signals.cpp │ │ ├── signals.cpp.license │ │ ├── signals.h │ │ ├── signals.h.license │ │ ├── signals.rs │ │ └── signals.rs.license │ └── update_expected.sh ├── cxx-qt-lib-extras │ ├── Cargo.toml │ ├── build.rs │ ├── include │ │ ├── core │ │ │ ├── qcommandlineoption.h │ │ │ ├── qcommandlineparser.h │ │ │ ├── qelapsedtimer.h │ │ │ └── qeventloop.h │ │ └── gui │ │ │ └── qapplication.h │ └── src │ │ ├── core │ │ ├── mod.rs │ │ ├── qcommandlineoption.cpp │ │ ├── qcommandlineoption.rs │ │ ├── qcommandlineparser.cpp │ │ ├── qcommandlineparser.rs │ │ ├── qelapsedtimer.cpp │ │ ├── qelapsedtimer.rs │ │ └── qeventloop.rs │ │ ├── gui │ │ ├── mod.rs │ │ ├── qapplication.cpp │ │ └── qapplication.rs │ │ ├── lib.rs │ │ └── qt_types.cpp ├── cxx-qt-lib │ ├── .gitattributes │ ├── Cargo.toml │ ├── build.rs │ ├── include │ │ ├── assertion_utils.h │ │ ├── common.h │ │ ├── core │ │ │ ├── qanystringview.h │ │ │ ├── qbytearray.h │ │ │ ├── qcoreapplication.h │ │ │ ├── qdate.h │ │ │ ├── qdatetime.h │ │ │ ├── qhash │ │ │ │ ├── qhash.h │ │ │ │ ├── qhash_QString_QVariant.h │ │ │ │ ├── qhash_i32_QByteArray.h │ │ │ │ └── qhash_private.h │ │ │ ├── qline.h │ │ │ ├── qlinef.h │ │ │ ├── qlist │ │ │ │ ├── qlist.h │ │ │ │ ├── qlist_QByteArray.h │ │ │ │ ├── qlist_QColor.h │ │ │ │ ├── qlist_QDate.h │ │ │ │ ├── qlist_QDateTime.h │ │ │ │ ├── qlist_QLine.h │ │ │ │ ├── qlist_QLineF.h │ │ │ │ ├── qlist_QMargins.h │ │ │ │ ├── qlist_QMarginsF.h │ │ │ │ ├── qlist_QPersistentModelIndex.h │ │ │ │ ├── qlist_QPoint.h │ │ │ │ ├── qlist_QPointF.h │ │ │ │ ├── qlist_QRect.h │ │ │ │ ├── qlist_QRectF.h │ │ │ │ ├── qlist_QSize.h │ │ │ │ ├── qlist_QSizeF.h │ │ │ │ ├── qlist_QString.h │ │ │ │ ├── qlist_QTime.h │ │ │ │ ├── qlist_QUrl.h │ │ │ │ ├── qlist_QUuid.h │ │ │ │ ├── qlist_QVariant.h │ │ │ │ ├── qlist_bool.h │ │ │ │ ├── qlist_f32.h │ │ │ │ ├── qlist_f64.h │ │ │ │ ├── qlist_i16.h │ │ │ │ ├── qlist_i32.h │ │ │ │ ├── qlist_i64.h │ │ │ │ ├── qlist_i8.h │ │ │ │ ├── qlist_private.h │ │ │ │ ├── qlist_u16.h │ │ │ │ ├── qlist_u32.h │ │ │ │ ├── qlist_u64.h │ │ │ │ └── qlist_u8.h │ │ │ ├── qlist_qvector.h │ │ │ ├── qmap │ │ │ │ ├── qmap.h │ │ │ │ ├── qmap_QString_QVariant.h │ │ │ │ └── qmap_private.h │ │ │ ├── qmargins.h │ │ │ ├── qmarginsf.h │ │ │ ├── qmetaobjectconnection.h │ │ │ ├── qmodelindex.h │ │ │ ├── qobject.h │ │ │ ├── qpersistentmodelindex.h │ │ │ ├── qpoint.h │ │ │ ├── qpointf.h │ │ │ ├── qrect.h │ │ │ ├── qrectf.h │ │ │ ├── qset │ │ │ │ ├── qset.h │ │ │ │ ├── qset_QByteArray.h │ │ │ │ ├── qset_QDate.h │ │ │ │ ├── qset_QDateTime.h │ │ │ │ ├── qset_QPersistentModelIndex.h │ │ │ │ ├── qset_QString.h │ │ │ │ ├── qset_QTime.h │ │ │ │ ├── qset_QUrl.h │ │ │ │ ├── qset_QUuid.h │ │ │ │ ├── qset_bool.h │ │ │ │ ├── qset_f32.h │ │ │ │ ├── qset_f64.h │ │ │ │ ├── qset_i16.h │ │ │ │ ├── qset_i32.h │ │ │ │ ├── qset_i64.h │ │ │ │ ├── qset_i8.h │ │ │ │ ├── qset_private.h │ │ │ │ ├── qset_u16.h │ │ │ │ ├── qset_u32.h │ │ │ │ ├── qset_u64.h │ │ │ │ └── qset_u8.h │ │ │ ├── qsize.h │ │ │ ├── qsizef.h │ │ │ ├── qstring.h │ │ │ ├── qstringlist.h │ │ │ ├── qt.h │ │ │ ├── qtime.h │ │ │ ├── qtimezone.h │ │ │ ├── qtlogging.h │ │ │ ├── qtypes.h │ │ │ ├── qurl.h │ │ │ ├── quuid.h │ │ │ ├── qvariant.h │ │ │ └── qvector │ │ │ │ ├── qvector.h │ │ │ │ ├── qvector_QByteArray.h │ │ │ │ ├── qvector_QColor.h │ │ │ │ ├── qvector_QDate.h │ │ │ │ ├── qvector_QDateTime.h │ │ │ │ ├── qvector_QLine.h │ │ │ │ ├── qvector_QLineF.h │ │ │ │ ├── qvector_QMargins.h │ │ │ │ ├── qvector_QMarginsF.h │ │ │ │ ├── qvector_QPersistentModelIndex.h │ │ │ │ ├── qvector_QPoint.h │ │ │ │ ├── qvector_QPointF.h │ │ │ │ ├── qvector_QRect.h │ │ │ │ ├── qvector_QRectF.h │ │ │ │ ├── qvector_QSize.h │ │ │ │ ├── qvector_QSizeF.h │ │ │ │ ├── qvector_QString.h │ │ │ │ ├── qvector_QTime.h │ │ │ │ ├── qvector_QUrl.h │ │ │ │ ├── qvector_QUuid.h │ │ │ │ ├── qvector_QVariant.h │ │ │ │ ├── qvector_bool.h │ │ │ │ ├── qvector_f32.h │ │ │ │ ├── qvector_f64.h │ │ │ │ ├── qvector_i16.h │ │ │ │ ├── qvector_i32.h │ │ │ │ ├── qvector_i64.h │ │ │ │ ├── qvector_i8.h │ │ │ │ ├── qvector_private.h │ │ │ │ ├── qvector_u16.h │ │ │ │ ├── qvector_u32.h │ │ │ │ ├── qvector_u64.h │ │ │ │ └── qvector_u8.h │ │ ├── gui │ │ │ ├── qcolor.h │ │ │ ├── qfont.h │ │ │ ├── qguiapplication.h │ │ │ ├── qimage.h │ │ │ ├── qpainter.h │ │ │ ├── qpainterpath.h │ │ │ ├── qpen.h │ │ │ ├── qpolygon.h │ │ │ ├── qpolygonf.h │ │ │ ├── qregion.h │ │ │ ├── qvector2d.h │ │ │ ├── qvector3d.h │ │ │ └── qvector4d.h │ │ ├── qml │ │ │ ├── qqmlapplicationengine.h │ │ │ └── qqmlengine.h │ │ └── quickcontrols │ │ │ └── qquickstyle.h │ └── src │ │ ├── core │ │ ├── init.cpp │ │ ├── mod.rs │ │ ├── qanystringview.cpp │ │ ├── qanystringview.rs │ │ ├── qbytearray.cpp │ │ ├── qbytearray.rs │ │ ├── qcoreapplication.cpp │ │ ├── qcoreapplication.rs │ │ ├── qdate.cpp │ │ ├── qdate.rs │ │ ├── qdatetime.cpp │ │ ├── qdatetime.rs │ │ ├── qflags │ │ │ ├── mod.rs │ │ │ ├── qflag.rs │ │ │ ├── repr.rs │ │ │ └── util.rs │ │ ├── qhash │ │ │ ├── generate.sh │ │ │ ├── mod.rs │ │ │ ├── qhash.cpp │ │ │ ├── qhash_i32_qbytearray.rs │ │ │ └── qhash_qstring_qvariant.rs │ │ ├── qline.cpp │ │ ├── qline.rs │ │ ├── qlinef.cpp │ │ ├── qlinef.rs │ │ ├── qlist │ │ │ ├── generate.sh │ │ │ ├── mod.rs │ │ │ ├── qlist.cpp │ │ │ ├── qlist_bool.rs │ │ │ ├── qlist_f32.rs │ │ │ ├── qlist_f64.rs │ │ │ ├── qlist_i16.rs │ │ │ ├── qlist_i32.rs │ │ │ ├── qlist_i64.rs │ │ │ ├── qlist_i8.rs │ │ │ ├── qlist_qbytearray.rs │ │ │ ├── qlist_qcolor.rs │ │ │ ├── qlist_qdate.rs │ │ │ ├── qlist_qdatetime.rs │ │ │ ├── qlist_qline.rs │ │ │ ├── qlist_qlinef.rs │ │ │ ├── qlist_qmargins.rs │ │ │ ├── qlist_qmarginsf.rs │ │ │ ├── qlist_qpersistentmodelindex.rs │ │ │ ├── qlist_qpoint.rs │ │ │ ├── qlist_qpointf.rs │ │ │ ├── qlist_qrect.rs │ │ │ ├── qlist_qrectf.rs │ │ │ ├── qlist_qsize.rs │ │ │ ├── qlist_qsizef.rs │ │ │ ├── qlist_qstring.rs │ │ │ ├── qlist_qtime.rs │ │ │ ├── qlist_qurl.rs │ │ │ ├── qlist_quuid.rs │ │ │ ├── qlist_qvariant.rs │ │ │ ├── qlist_u16.rs │ │ │ ├── qlist_u32.rs │ │ │ ├── qlist_u64.rs │ │ │ └── qlist_u8.rs │ │ ├── qmap │ │ │ ├── generate.sh │ │ │ ├── mod.rs │ │ │ ├── qmap.cpp │ │ │ └── qmap_qstring_qvariant.rs │ │ ├── qmargins.cpp │ │ ├── qmargins.rs │ │ ├── qmarginsf.cpp │ │ ├── qmarginsf.rs │ │ ├── qmodelindex.cpp │ │ ├── qmodelindex.rs │ │ ├── qobject.rs │ │ ├── qpersistentmodelindex.cpp │ │ ├── qpersistentmodelindex.rs │ │ ├── qpoint.cpp │ │ ├── qpoint.rs │ │ ├── qpointf.cpp │ │ ├── qpointf.rs │ │ ├── qrect.cpp │ │ ├── qrect.rs │ │ ├── qrectf.cpp │ │ ├── qrectf.rs │ │ ├── qset │ │ │ ├── generate.sh │ │ │ ├── mod.rs │ │ │ ├── qset.cpp │ │ │ ├── qset_bool.rs │ │ │ ├── qset_f32.rs │ │ │ ├── qset_f64.rs │ │ │ ├── qset_i16.rs │ │ │ ├── qset_i32.rs │ │ │ ├── qset_i64.rs │ │ │ ├── qset_i8.rs │ │ │ ├── qset_qbytearray.rs │ │ │ ├── qset_qdate.rs │ │ │ ├── qset_qdatetime.rs │ │ │ ├── qset_qpersistentmodelindex.rs │ │ │ ├── qset_qstring.rs │ │ │ ├── qset_qtime.rs │ │ │ ├── qset_qurl.rs │ │ │ ├── qset_quuid.rs │ │ │ ├── qset_u16.rs │ │ │ ├── qset_u32.rs │ │ │ ├── qset_u64.rs │ │ │ └── qset_u8.rs │ │ ├── qsize.cpp │ │ ├── qsize.rs │ │ ├── qsizef.cpp │ │ ├── qsizef.rs │ │ ├── qstring.cpp │ │ ├── qstring.rs │ │ ├── qstringlist.cpp │ │ ├── qstringlist.rs │ │ ├── qt.rs │ │ ├── qtime.cpp │ │ ├── qtime.rs │ │ ├── qtimezone.cpp │ │ ├── qtimezone.rs │ │ ├── qtlogging.cpp │ │ ├── qtlogging.rs │ │ ├── qtypes.cpp │ │ ├── qtypes.rs │ │ ├── qurl.cpp │ │ ├── qurl.rs │ │ ├── quuid.cpp │ │ ├── quuid.rs │ │ ├── qvariant │ │ │ ├── generate.sh │ │ │ ├── mod.rs │ │ │ ├── qvariant.cpp │ │ │ ├── qvariant_bool.rs │ │ │ ├── qvariant_f32.rs │ │ │ ├── qvariant_f64.rs │ │ │ ├── qvariant_i16.rs │ │ │ ├── qvariant_i32.rs │ │ │ ├── qvariant_i64.rs │ │ │ ├── qvariant_i8.rs │ │ │ ├── qvariant_qbytearray.rs │ │ │ ├── qvariant_qcolor.rs │ │ │ ├── qvariant_qdate.rs │ │ │ ├── qvariant_qdatetime.rs │ │ │ ├── qvariant_qmodelindex.rs │ │ │ ├── qvariant_qpersistentmodelindex.rs │ │ │ ├── qvariant_qpoint.rs │ │ │ ├── qvariant_qpointf.rs │ │ │ ├── qvariant_qrect.rs │ │ │ ├── qvariant_qrectf.rs │ │ │ ├── qvariant_qsize.rs │ │ │ ├── qvariant_qsizef.rs │ │ │ ├── qvariant_qstring.rs │ │ │ ├── qvariant_qstringlist.rs │ │ │ ├── qvariant_qtime.rs │ │ │ ├── qvariant_qurl.rs │ │ │ ├── qvariant_quuid.rs │ │ │ ├── qvariant_u16.rs │ │ │ ├── qvariant_u32.rs │ │ │ ├── qvariant_u64.rs │ │ │ └── qvariant_u8.rs │ │ └── qvector │ │ │ ├── generate.sh │ │ │ ├── mod.rs │ │ │ ├── qvector.cpp │ │ │ ├── qvector_bool.rs │ │ │ ├── qvector_f32.rs │ │ │ ├── qvector_f64.rs │ │ │ ├── qvector_i16.rs │ │ │ ├── qvector_i32.rs │ │ │ ├── qvector_i64.rs │ │ │ ├── qvector_i8.rs │ │ │ ├── qvector_qbytearray.rs │ │ │ ├── qvector_qcolor.rs │ │ │ ├── qvector_qdate.rs │ │ │ ├── qvector_qdatetime.rs │ │ │ ├── qvector_qline.rs │ │ │ ├── qvector_qlinef.rs │ │ │ ├── qvector_qmargins.rs │ │ │ ├── qvector_qmarginsf.rs │ │ │ ├── qvector_qpersistentmodelindex.rs │ │ │ ├── qvector_qpoint.rs │ │ │ ├── qvector_qpointf.rs │ │ │ ├── qvector_qrect.rs │ │ │ ├── qvector_qrectf.rs │ │ │ ├── qvector_qsize.rs │ │ │ ├── qvector_qsizef.rs │ │ │ ├── qvector_qstring.rs │ │ │ ├── qvector_qtime.rs │ │ │ ├── qvector_qurl.rs │ │ │ ├── qvector_quuid.rs │ │ │ ├── qvector_qvariant.rs │ │ │ ├── qvector_u16.rs │ │ │ ├── qvector_u32.rs │ │ │ ├── qvector_u64.rs │ │ │ └── qvector_u8.rs │ │ ├── gui │ │ ├── init.cpp │ │ ├── mod.rs │ │ ├── qcolor.cpp │ │ ├── qcolor.rs │ │ ├── qfont.cpp │ │ ├── qfont.rs │ │ ├── qguiapplication.cpp │ │ ├── qguiapplication.rs │ │ ├── qimage.cpp │ │ ├── qimage.rs │ │ ├── qpainter.cpp │ │ ├── qpainter.rs │ │ ├── qpainterpath.cpp │ │ ├── qpainterpath.rs │ │ ├── qpen.cpp │ │ ├── qpen.rs │ │ ├── qpolygon.cpp │ │ ├── qpolygon.rs │ │ ├── qpolygonf.cpp │ │ ├── qpolygonf.rs │ │ ├── qregion.cpp │ │ ├── qregion.rs │ │ ├── qvector2d.cpp │ │ ├── qvector2d.rs │ │ ├── qvector3d.cpp │ │ ├── qvector3d.rs │ │ ├── qvector4d.cpp │ │ └── qvector4d.rs │ │ ├── lib.rs │ │ ├── qml │ │ ├── mod.rs │ │ ├── qqmlapplicationengine.cpp │ │ ├── qqmlapplicationengine.rs │ │ ├── qqmlengine.cpp │ │ └── qqmlengine.rs │ │ ├── qt_types.cpp │ │ ├── quickcontrols │ │ ├── mod.rs │ │ └── qquickstyle.rs │ │ ├── serde_impl.rs │ │ └── util.rs ├── cxx-qt-macro │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── cxx-qt │ ├── Cargo.toml │ ├── README.md │ ├── build.rs │ ├── include │ │ ├── casting.h │ │ ├── connection.h │ │ ├── signalhandler.h │ │ ├── thread.h │ │ ├── threading.h │ │ └── type.h │ └── src │ │ ├── casting.rs │ │ ├── connection.cpp │ │ ├── connection.rs │ │ ├── connectionguard.rs │ │ ├── init.cpp │ │ ├── lib.rs │ │ ├── qobject.rs │ │ ├── signalhandler.rs │ │ └── threading.rs └── qt-build-utils │ ├── Cargo.toml │ └── src │ ├── error.rs │ ├── initializer.rs │ ├── installation │ ├── mod.rs │ └── qmake.rs │ ├── lib.rs │ ├── parse_cflags.rs │ ├── tool │ ├── moc.rs │ ├── mod.rs │ ├── qmlcachegen.rs │ ├── qmltyperegistrar.rs │ └── rcc.rs │ └── utils.rs ├── examples ├── CMakeLists.txt ├── README.md ├── cargo_without_cmake │ ├── Cargo.toml │ ├── build.rs │ ├── qml │ └── src │ │ ├── cxxqt_object.rs │ │ └── main.rs ├── demo_threading │ ├── CMakeLists.txt │ ├── bad_client.py │ ├── client.py │ ├── cpp │ │ ├── helpers │ │ │ ├── energyusageproxymodel.cpp │ │ │ ├── energyusageproxymodel.h │ │ │ ├── sensor.cpp │ │ │ └── sensor.h │ │ └── main.cpp │ ├── demo.py │ ├── images │ │ ├── RLogo.png │ │ ├── RLogo.png.license │ │ ├── RLogolarge.png │ │ ├── RLogolarge.png.license │ │ ├── activeInner.png │ │ ├── activeInner.png.license │ │ ├── activeOuter.png │ │ ├── activeOuter.png.license │ │ ├── beach1.png │ │ ├── beach1.png.license │ │ ├── beach2.png │ │ ├── beach2.png.license │ │ ├── bg.png │ │ ├── bg.png.license │ │ ├── iconSensors.png │ │ ├── iconSensors.png.license │ │ ├── iconwirless.png │ │ ├── iconwirless.png.license │ │ ├── images.qrc │ │ ├── images.qrc.license │ │ ├── inactiveInner.png │ │ ├── inactiveInner.png.license │ │ ├── inactiveOuter.png │ │ ├── inactiveOuter.png.license │ │ ├── kdabLogo.png │ │ ├── kdabLogo.png.license │ │ ├── level0.png │ │ ├── level0.png.license │ │ ├── level0i.png │ │ ├── level0i.png.license │ │ ├── level1.png │ │ ├── level1.png.license │ │ ├── level1i.png │ │ ├── level1i.png.license │ │ ├── level2.png │ │ ├── level2.png.license │ │ ├── level2i.png │ │ ├── level2i.png.license │ │ ├── level3.png │ │ ├── level3.png.license │ │ ├── ocean.png │ │ ├── ocean.png.license │ │ ├── panel.png │ │ ├── panel.png.license │ │ ├── qt-logo.png │ │ ├── qt-logo.png.license │ │ ├── rust-logo-white.png │ │ ├── rust-logo-white.png.license │ │ ├── sensor.png │ │ ├── sensor.png.license │ │ ├── sensorefect.png │ │ ├── sensorefect.png.license │ │ ├── sideshadow.png │ │ └── sideshadow.png.license │ ├── qml │ │ ├── Button.qml │ │ ├── MainWindow.qml │ │ ├── Panel.qml │ │ ├── SensorUI.qml │ │ ├── SideText.qml │ │ └── compat │ │ │ ├── ConicalGradientQt5.qml │ │ │ ├── ConicalGradientQt6.qml │ │ │ ├── OpacityMaskQt5.qml │ │ │ ├── OpacityMaskQt6.qml │ │ │ ├── compat_qt5.qrc │ │ │ ├── compat_qt5.qrc.license │ │ │ ├── compat_qt6.qrc │ │ │ └── compat_qt6.qrc.license │ └── rust │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ ├── constants.rs │ │ ├── lib.rs │ │ ├── network │ │ ├── mod.rs │ │ ├── request.rs │ │ ├── response.rs │ │ └── server.rs │ │ └── workers │ │ ├── accumulator.rs │ │ ├── mod.rs │ │ ├── sensors.rs │ │ └── timeout.rs ├── qml_basics │ ├── Cargo.toml │ ├── build.rs │ ├── qml │ │ └── main.qml │ └── src │ │ └── main.rs ├── qml_features │ ├── CMakeLists.txt │ ├── cpp │ │ ├── custom_object.cpp │ │ ├── custom_object.h │ │ ├── external_qobject.cpp │ │ ├── external_qobject.h │ │ └── main.cpp │ ├── qml │ │ ├── images │ │ │ ├── images.qrc │ │ │ ├── images.qrc.license │ │ │ ├── red.png │ │ │ └── red.png.license │ │ ├── main.qml │ │ └── pages │ │ │ ├── ContainersPage.qml │ │ │ ├── CustomBaseClassPage.qml │ │ │ ├── CustomParentClassPage.qml │ │ │ ├── ExternCxxQtPage.qml │ │ │ ├── InvokablesPage.qml │ │ │ ├── MultipleQObjectsPage.qml │ │ │ ├── NamingPage.qml │ │ │ ├── NestedQObjectsPage.qml │ │ │ ├── PropertiesPage.qml │ │ │ ├── SerialisationPage.qml │ │ │ ├── SignalsPage.qml │ │ │ ├── SingletonPage.qml │ │ │ ├── ThreadingPage.qml │ │ │ └── TypesPage.qml │ ├── rust │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── containers.rs │ │ │ ├── custom_base_class.rs │ │ │ ├── custom_parent_class.rs │ │ │ ├── empty.rs │ │ │ ├── empty_bridge.rs │ │ │ ├── externcxxqt.rs │ │ │ ├── invokables.rs │ │ │ ├── lib.rs │ │ │ ├── multiple_qobjects.rs │ │ │ ├── naming.rs │ │ │ ├── nested_qobjects.rs │ │ │ ├── properties.rs │ │ │ ├── serialisation.rs │ │ │ ├── signals.rs │ │ │ ├── singleton.rs │ │ │ ├── threading.rs │ │ │ ├── types.rs │ │ │ └── uncreatable.rs │ └── tests │ │ ├── main.cpp │ │ ├── tst_containers.qml │ │ ├── tst_custom_base_class.qml │ │ ├── tst_custom_parent_class.qml │ │ ├── tst_externcxxqt.qml │ │ ├── tst_invokables.qml │ │ ├── tst_multiple_qobjects.qml │ │ ├── tst_naming.qml │ │ ├── tst_nested_qobjects.qml │ │ ├── tst_properties.qml │ │ ├── tst_qrc.qml │ │ ├── tst_serialisation.qml │ │ ├── tst_signals.qml │ │ ├── tst_singleton.qml │ │ ├── tst_threading.qml │ │ ├── tst_types.qml │ │ └── tst_uncreatable.qml ├── qml_minimal │ ├── CMakeLists.txt │ ├── cpp │ │ └── main.cpp │ ├── qml │ │ └── main.qml │ ├── rust │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── cxxqt_object.rs │ │ │ └── lib.rs │ └── tests │ │ └── myobject │ │ ├── tst_myobject.cpp │ │ └── tst_myobject.qml ├── qml_multi_crates │ ├── CMakeLists.txt │ ├── cpp │ │ └── main.cpp │ ├── qml │ │ └── main.qml │ └── rust │ │ ├── main │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── main.rs │ │ │ └── main_object.rs │ │ ├── sub1 │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ │ ├── lib.rs │ │ │ └── sub1_object.rs │ │ └── sub2 │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ ├── lib.rs │ │ └── sub2_object.rs └── todo_app │ ├── Cargo.toml │ ├── build.rs │ ├── qml │ └── main.qml │ └── src │ ├── main.rs │ └── todo_list.rs ├── scripts ├── check_cargo_build_rerun.sh ├── clang_format_check.sh ├── clang_format_inplace.sh ├── grcov_cxx_qt.sh └── release_crates.sh ├── tests ├── CMakeLists.txt ├── basic_cxx_only │ ├── CMakeLists.txt │ ├── cpp │ │ ├── cxx_test.cpp │ │ ├── cxx_test.h │ │ └── main.cpp │ └── rust │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ └── lib.rs ├── basic_cxx_qt │ ├── CMakeLists.txt │ ├── cpp │ │ └── main.cpp │ └── rust │ │ ├── Cargo.toml │ │ ├── build.rs │ │ └── src │ │ ├── data.rs │ │ ├── empty.rs │ │ ├── lib.rs │ │ ├── naming.rs │ │ └── types.rs └── qt_types_standalone │ ├── CMakeLists.txt │ ├── cpp │ ├── main.cpp │ ├── qanystringview.h │ ├── qbytearray.h │ ├── qcolor.h │ ├── qcoreapplication.h │ ├── qdate.h │ ├── qdatetime.h │ ├── qflags.h │ ├── qguiapplication.h │ ├── qhash.h │ ├── qline.h │ ├── qlinef.h │ ├── qlist.h │ ├── qmap.h │ ├── qmargins.h │ ├── qmarginsf.h │ ├── qmetaobjectconnection.h │ ├── qmodelindex.h │ ├── qpen.h │ ├── qpersistentmodelindex.h │ ├── qpoint.h │ ├── qpointf.h │ ├── qpolygon.h │ ├── qpolygonf.h │ ├── qqmlapplicationengine.h │ ├── qqmlengine.h │ ├── qrect.h │ ├── qrectf.h │ ├── qregion.h │ ├── qset.h │ ├── qsize.h │ ├── qsizef.h │ ├── qstring.h │ ├── qstringlist.h │ ├── qtime.h │ ├── qtimezone.h │ ├── qurl.h │ ├── qvariant.h │ ├── qvector.h │ ├── qvector2d.h │ ├── qvector3d.h │ └── qvector4d.h │ └── rust │ ├── Cargo.toml │ ├── build.rs │ └── src │ ├── lib.rs │ ├── qanystringview.rs │ ├── qbytearray.rs │ ├── qcolor.rs │ ├── qcoreapplication.rs │ ├── qdate.rs │ ├── qdatetime.rs │ ├── qflags.rs │ ├── qguiapplication.rs │ ├── qhash.rs │ ├── qline.rs │ ├── qlinef.rs │ ├── qlist.rs │ ├── qmap.rs │ ├── qmargins.rs │ ├── qmarginsf.rs │ ├── qmetaobjectconnection.rs │ ├── qmodelindex.rs │ ├── qpen.rs │ ├── qpersistentmodelindex.rs │ ├── qpoint.rs │ ├── qpointf.rs │ ├── qpolygon.rs │ ├── qpolygonf.rs │ ├── qqmlapplicationengine.rs │ ├── qqmlengine.rs │ ├── qrect.rs │ ├── qrectf.rs │ ├── qregion.rs │ ├── qset.rs │ ├── qsize.rs │ ├── qsizef.rs │ ├── qstring.rs │ ├── qstringlist.rs │ ├── qtime.rs │ ├── qtimezone.rs │ ├── qurl.rs │ ├── qvariant.rs │ ├── qvector.rs │ ├── qvector2d.rs │ ├── qvector3d.rs │ └── qvector4d.rs ├── valgrind_suppressions.txt └── valgrind_suppressions.txt.license /.clang-format: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-FileContributor: Gerhard de Clercq 4 | # 5 | # SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | BasedOnStyle: Mozilla 8 | -------------------------------------------------------------------------------- /.clangd: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Leon Matthes 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | CompileFlags: 6 | Add: [-DCXX_QT_GUI_FEATURE=1] 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-FileContributor: Gerhard de Clercq 4 | # 5 | # SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | .vscode/ 8 | **/target/ 9 | **/coverage/ 10 | **/build*/ 11 | cargo/* 12 | **/mdbook/* 13 | **/mdbook-linkcheck/* 14 | pip3/* 15 | rustup/* 16 | CMakeLists.txt.user 17 | 18 | # clangd 19 | compile_commands.json 20 | 21 | # cmps (https://github.com/leonmatthes/cmps) 22 | .cmps/ 23 | 24 | # clangd cache 25 | .cache/ 26 | -------------------------------------------------------------------------------- /.markdownlint.jsonc: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | SPDX-FileContributor: Matt Aber 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 6 | */ 7 | 8 | { 9 | "MD033": false, // no-inline-html 10 | "MD013": false, // line-length 11 | "MD028": false, // no-blanks-blockquote 12 | "MD014": false // commands-show-output 13 | } 14 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Contributor Covenant Authors 2 | # 3 | # SPDX-License-Identifier: CC-BY-4.0 4 | -------------------------------------------------------------------------------- /Cargo.lock.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /LICENSES/LicenseRef-KDABProprietary.txt: -------------------------------------------------------------------------------- 1 | Copyright Klarälvdalens Datakonsult AB, a KDAB Group company . All Rights Reserved. 2 | -------------------------------------------------------------------------------- /LICENSES/LicenseRef-QtProprietary.txt: -------------------------------------------------------------------------------- 1 | Copyright The Qt Company. All Rights Reserved. 2 | -------------------------------------------------------------------------------- /book/.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | /book 7 | -------------------------------------------------------------------------------- /book/.markdownlint.jsonc: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | SPDX-FileContributor: Matt Aber 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 6 | */ 7 | 8 | { 9 | "MD033": false, 10 | "MD013": false, 11 | "MD028": false, 12 | "MD014": false 13 | } 14 | -------------------------------------------------------------------------------- /book/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | # Add unit test for book 7 | add_test(NAME book_build COMMAND mdbook build WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 8 | add_test(NAME book_test COMMAND mdbook test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 9 | -------------------------------------------------------------------------------- /book/book.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | [book] 7 | authors = ["Andrew Hayzen "] 8 | language = "en" 9 | multilingual = false 10 | src = "src" 11 | title = "CXX-Qt Documentation" 12 | 13 | [output.html] 14 | 15 | [output.linkcheck] 16 | -------------------------------------------------------------------------------- /book/src/concepts/index.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | # Core Concepts 10 | 11 | CXX-Qt uses [CXX](https://cxx.rs/) for bridging between C++ and Rust safely. 12 | 13 | The main purpose of CXX-Qt is to expose Qt's extensions to the C++ language to CXX. 14 | 15 | - [Supported types between Rust and C++](./types.md) 16 | - [Build Systems](./build_systems.md) 17 | - [Building for WebAssembly](./wasm-builds.md) 18 | - [Generated QObject](./generated_qobject.md) 19 | - [Nesting Rust objects](./nested_objects.md) 20 | - [Inheriting `QObjects` and overriding methods](./inheritance.md) 21 | -------------------------------------------------------------------------------- /book/src/images/export_images.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 4 | # SPDX-FileContributor: Andrew Hayzen 5 | # 6 | # SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | set -e 9 | 10 | SCRIPT=$(realpath "$0") 11 | SCRIPTPATH=$(dirname "$SCRIPT") 12 | 13 | function dot_to_svg() { 14 | dot -Tsvg "$1.dot" > "$1.svg" 15 | } 16 | 17 | dot_to_svg "$SCRIPTPATH/overview_abstract" 18 | -------------------------------------------------------------------------------- /book/src/images/overview_abstract.svg.license: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /book/src/internals/index.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | # CXX-Qt Internals 9 | 10 | This chapter explains some of CXX-Qts internal architecture and design decisions. 11 | 12 | The sections are mostly meant for CXX-Qt contributors, but may be interesting for a more comprehensive view for users of CXX-Qt as well. 13 | -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Ben Ford 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | # This is higher than the rust-version because the `incompatible_msrv` lint was introduced in clippy 1.78.0 7 | msrv = "1.78.0" 8 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Ben Ford 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | coverage: 7 | status: 8 | project: 9 | default: 10 | target: 100% 11 | patch: true 12 | 13 | 14 | ignore: 15 | - "./tests/" # This got included for some reason in either build or test and is not relevant to unit tests -------------------------------------------------------------------------------- /crates/cxx-qt-gen/src/generator/cpp/property/getter.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use crate::generator::{ 7 | cpp::fragment::CppFragment, 8 | naming::property::{NameState, QPropertyNames}, 9 | }; 10 | 11 | pub fn generate(idents: &QPropertyNames, return_cxx_ty: &str) -> Option { 12 | if let NameState::Auto(name) = &idents.getter { 13 | Some(CppFragment::Header(format!( 14 | "{return_cxx_ty} const& {ident_getter}() const noexcept;", 15 | ident_getter = name.cxx_unqualified() 16 | ))) 17 | } else { 18 | None 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/src/generator/cpp/property/setter.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use crate::generator::{ 7 | cpp::fragment::CppFragment, 8 | naming::property::{NameState, QPropertyNames}, 9 | }; 10 | 11 | pub fn generate(idents: &QPropertyNames, cxx_ty: &str) -> Option { 12 | // Only generates setter code if the state provided is Auto (not custom provided by user) 13 | if let Some(NameState::Auto(setter)) = &idents.setter { 14 | Some(CppFragment::Header(format!( 15 | "Q_SLOT void {ident_setter}({cxx_ty} value) noexcept;", 16 | ident_setter = setter.cxx_unqualified(), 17 | ))) 18 | } else { 19 | None 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/src/generator/cpp/qnamespace.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Leon Matthes 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use std::collections::BTreeSet; 7 | 8 | use indoc::formatdoc; 9 | 10 | use crate::{parser::qnamespace::ParsedQNamespace, writer::cpp::namespaced}; 11 | 12 | /// Generate the declaration of the namespace, including the Q_NAMESPACE macro. 13 | pub fn generate(qnamespace: &ParsedQNamespace, includes: &mut BTreeSet) -> String { 14 | includes.insert("#include ".to_string()); 15 | let mut result = "Q_NAMESPACE".to_owned(); 16 | if qnamespace.qml_element { 17 | includes.insert("#include ".to_string()); 18 | result = formatdoc! { r#" 19 | {result} 20 | QML_ELEMENT"#}; 21 | } 22 | namespaced(&qnamespace.namespace, &result) 23 | } 24 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/src/generator/naming/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | pub mod namespace; 6 | pub mod property; 7 | pub mod qobject; 8 | pub mod signals; 9 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/src/naming/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | //! This module provides utils for working with syn, CXX, and C++. 7 | //! 8 | //! Such as converting a [syn::Type] into a C++ string, or determining 9 | //! if a type is unsafe in a CXX bridge. 10 | //! 11 | //! The idea of this module is that it should be independent as 12 | //! these methods could be split out into a cxx-utils crate later on. 13 | 14 | pub(crate) mod cpp; 15 | mod name; 16 | pub(crate) mod rust; 17 | mod type_names; 18 | 19 | pub use name::Name; 20 | pub use type_names::TypeNames; 21 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/src/shorthand/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Ben Ford 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | // TODO! Add our other shorthands into this module? 7 | pub mod self_inlining; 8 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/src/syntax/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | pub mod attribute; 7 | pub mod cfg; 8 | pub mod expr; 9 | pub mod foreignmod; 10 | pub mod lifetimes; 11 | pub mod path; 12 | mod qtfile; 13 | mod qtitem; 14 | pub mod types; 15 | 16 | pub use qtfile::{parse_qt_file, CxxQtFile}; 17 | pub use qtitem::CxxQtItem; 18 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/src/writer/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | pub mod cpp; 7 | pub mod rust; 8 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_inputs/cfgs.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_inputs/inheritance.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Leon Matthes 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_inputs/invokables.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_inputs/passthrough_and_naming.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_inputs/properties.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_inputs/qenum.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Leon Matthes 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_inputs/shebang.rs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ 2 | // Test for qtitem and qtfile, for code coverage 3 | #[cxx_qt::bridge] 4 | mod ffi { 5 | extern "RustQt" { 6 | #[qobject] 7 | type MyObject = super::MyObjectRust; 8 | } 9 | 10 | unsafe extern "RustQt" { 11 | fn my_fn(self: &MyObject); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_inputs/shebang.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Ben Ford 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_inputs/signals.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/cfgs.cpp.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/cfgs.h.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/cfgs.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/inheritance.cpp: -------------------------------------------------------------------------------- 1 | #include "directory/file_ident.cxxqt.h" 2 | 3 | MyObject::MyObject(QObject* parent) 4 | : QAbstractItemModel(parent) 5 | , ::rust::cxxqt1::CxxQtType(::cxx_qt_MyObject::createRs()) 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/inheritance.cpp.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Leon Matthes 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/inheritance.h.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Leon Matthes 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/inheritance.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Leon Matthes 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/invokables.cpp.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/invokables.h.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/invokables.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/passthrough_and_naming.cpp.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/passthrough_and_naming.h.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/passthrough_and_naming.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/properties.cpp.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/properties.h.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/properties.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Gerhard de Clercq 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/qenum.cpp: -------------------------------------------------------------------------------- 1 | #include "directory/file_ident.cxxqt.h" 2 | 3 | namespace cxx_qt::my_object { 4 | MyObject::MyObject(QObject* parent) 5 | : QObject(parent) 6 | , ::rust::cxxqt1::CxxQtType( 7 | ::cxx_qt::my_object::cxx_qt_MyObject::createRs()) 8 | { 9 | } 10 | 11 | } // namespace cxx_qt::my_object 12 | 13 | namespace cxx_qt::my_object { 14 | CxxName::CxxName(QObject* parent) 15 | : QObject(parent) 16 | , ::rust::cxxqt1::CxxQtType( 17 | ::cxx_qt::my_object::cxx_qt_MyRenamedObject::createRs()) 18 | { 19 | } 20 | 21 | } // namespace cxx_qt::my_object 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/qenum.cpp.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Leon Matthes 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/qenum.h.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Leon Matthes 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/qenum.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Leon Matthes 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/signals.cpp.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/signals.h.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/test_outputs/signals.rs.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 -------------------------------------------------------------------------------- /crates/cxx-qt-gen/update_expected.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 4 | # SPDX-FileContributor: Leon Matthes 5 | # 6 | # SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | 9 | set -ex 10 | 11 | SCRIPT=$(realpath "$0") 12 | SCRIPT_DIR=$(dirname "$SCRIPT") 13 | 14 | cd "${SCRIPT_DIR}" 15 | CXX_QT_UPDATE_EXPECTED="${SCRIPT_DIR}" cargo test tests::generates 16 | 17 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib-extras/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Laurent Montel 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | [package] 6 | name = "cxx-qt-lib-extras" 7 | version.workspace = true 8 | authors = ["Laurent Montel "] 9 | edition.workspace = true 10 | license.workspace = true 11 | description = "Extra Qt types for integrating `cxx-qt` crate with `cxx` that are not available in `cxx-qt-lib`" 12 | repository.workspace = true 13 | links = "cxx-qt-lib-extras" 14 | rust-version.workspace = true 15 | 16 | [dependencies] 17 | cxx.workspace = true 18 | cxx-qt.workspace = true 19 | cxx-qt-lib = { workspace = true, features = ["qt_full"] } 20 | 21 | [build-dependencies] 22 | cxx-qt-build.workspace = true 23 | 24 | [features] 25 | default = [] 26 | link_qt_object_files = ["cxx-qt-build/link_qt_object_files"] 27 | 28 | [lints] 29 | workspace = true 30 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib-extras/include/core/qcommandlineoption.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include "rust/cxx.h" 12 | 13 | // Define namespace otherwise we hit a GCC bug 14 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 15 | namespace rust { 16 | 17 | template<> 18 | struct IsRelocatable : ::std::true_type 19 | {}; 20 | 21 | } // namespace rust 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib-extras/include/core/qelapsedtimer.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include "rust/cxx.h" 12 | 13 | namespace rust { 14 | namespace cxxqtlib1 { 15 | ::std::int64_t 16 | qelapsedtimerRestart(QElapsedTimer& elapsedTimer); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib-extras/include/gui/qapplication.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include 12 | #include 13 | 14 | #include "rust/cxx.h" 15 | 16 | namespace rust { 17 | namespace cxxqtlib1 { 18 | 19 | ::std::unique_ptr 20 | qapplicationNew(const QVector& args); 21 | 22 | void 23 | qapplicationSetFont(QApplication& app, const QFont& font); 24 | 25 | QFont 26 | qapplicationFont(const QApplication& app); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib-extras/src/core/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Laurent Montel 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | mod qeventloop; 7 | pub use qeventloop::{QEventLoop, QEventLoopProcessEventsFlag, QEventLoopProcessEventsFlags}; 8 | 9 | mod qelapsedtimer; 10 | pub use qelapsedtimer::QElapsedTimer; 11 | 12 | mod qcommandlineoption; 13 | pub use qcommandlineoption::QCommandLineOption; 14 | 15 | mod qcommandlineparser; 16 | pub use qcommandlineparser::QCommandLineParser; 17 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib-extras/src/gui/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Laurent Montel 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | mod qapplication; 7 | pub use qapplication::QApplication; 8 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib-extras/src/lib.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Laurent Montel 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | #[cfg(not(any(cxxqt_qt_version_major = "5", cxxqt_qt_version_major = "6")))] 7 | compile_error!("cxxqt_qt_version_major must be either \"5\" or \"6\""); 8 | 9 | mod core; 10 | pub use crate::core::*; 11 | 12 | mod gui; 13 | pub use crate::gui::*; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib-extras/src/qt_types.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include 9 | #include 10 | 11 | // Ensure that std::size_t is the size that Rust is expecting. 12 | // This is the same as CXX does internally 13 | // https://github.com/dtolnay/cxx/blob/5a7f93bd1361857c1bcd41f203d55f13ad0ccdf9/src/cxx.cc#L391 14 | static_assert(sizeof(::std::size_t) == sizeof(::std::uintptr_t), 15 | "unsupported size_t size"); 16 | static_assert(alignof(::std::size_t) == alignof(::std::uintptr_t), 17 | "unsupported size_t alignment"); 18 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/assertion_utils.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // SPDX-FileContributor: Matt Aber 7 | // 8 | // SPDX-License-Identifier: MIT OR Apache-2.0 9 | #pragma once 10 | 11 | #define assert_alignment_and_size(TYPE, MEMBERS) \ 12 | namespace { \ 13 | struct s##TYPE MEMBERS; \ 14 | } \ 15 | static_assert(alignof(s##TYPE) == alignof(TYPE)); \ 16 | static_assert(sizeof(s##TYPE) == sizeof(TYPE)) 17 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qanystringview.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Joshua Goins 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "rust/cxx.h" 14 | 15 | // Define namespace otherwise we hit a GCC bug 16 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 17 | namespace rust { 18 | 19 | template<> 20 | struct IsRelocatable : ::std::true_type 21 | {}; 22 | 23 | } // namespace rust 24 | 25 | namespace rust { 26 | namespace cxxqtlib1 { 27 | 28 | QAnyStringView 29 | qanystringviewInitFromRustString(::rust::Str string); 30 | 31 | ::rust::isize 32 | qanystringviewLen(const QAnyStringView& string); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qhash/qhash.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Joshua Booth 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #pragma once 9 | 10 | #include "qhash_QString_QVariant.h" 11 | #include "qhash_i32_QByteArray.h" 12 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qhash/qhash_QString_QVariant.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qhash/generate.sh 10 | #pragma once 11 | #include "qhash_private.h" 12 | #include 13 | #include 14 | using QHash_QString_QVariant = QHash<::QString, ::QVariant>; 15 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qhash/qhash_i32_QByteArray.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qhash/generate.sh 10 | #pragma once 11 | #include "qhash_private.h" 12 | 13 | #include 14 | using QHash_i32_QByteArray = QHash<::std::int32_t, ::QByteArray>; 15 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qline.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlinef.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QByteArray.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QByteArray = QList<::QByteArray>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QColor.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QColor = QList<::QColor>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QDate.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QDate = QList<::QDate>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QDateTime.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QDateTime = QList<::QDateTime>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QLine.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QLine = QList<::QLine>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QLineF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QLineF = QList<::QLineF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QMargins.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QMargins = QList<::QMargins>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QMarginsF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QMarginsF = QList<::QMarginsF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QPersistentModelIndex.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QPersistentModelIndex = QList<::QPersistentModelIndex>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QPoint.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QPoint = QList<::QPoint>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QPointF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QPointF = QList<::QPointF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QRect.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QRect = QList<::QRect>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QRectF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QRectF = QList<::QRectF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QSize.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QSize = QList<::QSize>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QSizeF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QSizeF = QList<::QSizeF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QString.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QString = QList<::QString>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QTime.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QTime = QList<::QTime>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QUrl.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QUrl = QList<::QUrl>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QUuid.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QUuid = QList<::QUuid>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_QVariant.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | #include 13 | using QList_QVariant = QList<::QVariant>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_bool.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_bool = QList; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_f32.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_f32 = QList; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_f64.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_f64 = QList; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_i16.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_i16 = QList<::std::int16_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_i32.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_i32 = QList<::std::int32_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_i64.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_i64 = QList; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_i8.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_i8 = QList<::std::int8_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_u16.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_u16 = QList<::std::uint16_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_u32.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_u32 = QList<::std::uint32_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_u64.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_u64 = QList<::std::uint64_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist/qlist_u8.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qlist/generate.sh 10 | #pragma once 11 | #include "qlist_private.h" 12 | 13 | using QList_u8 = QList<::std::uint8_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qlist_qvector.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | // In Qt 6 QList and QVector are the same, so we only need IsRelocatable defined 12 | // once 13 | #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) 14 | 15 | #include 16 | 17 | #include "rust/cxx.h" 18 | 19 | // Define namespace otherwise we hit a GCC bug 20 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 21 | namespace rust { 22 | 23 | // This has static asserts in the cpp file to ensure this is valid. 24 | template 25 | struct IsRelocatable> : ::std::true_type 26 | {}; 27 | 28 | } // namespace rust 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qmap/qmap.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Joshua Booth 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #pragma once 9 | 10 | #include "qmap_QString_QVariant.h" 11 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qmap/qmap_QString_QVariant.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qmap/generate.sh 10 | #pragma once 11 | #include "qmap_private.h" 12 | #include 13 | #include 14 | using QMap_QString_QVariant = QMap<::QString, ::QVariant>; 15 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qmargins.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qmarginsf.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qmetaobjectconnection.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | // Re-export QMetaObjectConnection from cxx-qt 10 | #include "cxx-qt/connection.h" 11 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qmodelindex.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include 12 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qobject.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Ben Ford 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qpersistentmodelindex.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include "rust/cxx.h" 12 | 13 | // Define namespace otherwise we hit a GCC bug 14 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 15 | namespace rust { 16 | 17 | // This has static asserts in the cpp file to ensure this is valid. 18 | template<> 19 | struct IsRelocatable : ::std::true_type 20 | {}; 21 | 22 | } // namespace rust 23 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qpoint.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #pragma once 9 | 10 | #include 11 | 12 | #include 13 | 14 | namespace rust { 15 | namespace cxxqtlib1 { 16 | 17 | inline ::std::int32_t (*qpointDotProduct)(const QPoint&, 18 | const QPoint&) = QPoint::dotProduct; 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qpointf.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace rust { 13 | namespace cxxqtlib1 { 14 | 15 | inline double (*qpointfDotProduct)(const QPointF&, 16 | const QPointF&) = QPointF::dotProduct; 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qrect.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #pragma once 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qrectf.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #pragma once 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #pragma once 9 | #include "qset_QByteArray.h" 10 | #include "qset_QDate.h" 11 | #include "qset_QDateTime.h" 12 | #include "qset_QPersistentModelIndex.h" 13 | #include "qset_QString.h" 14 | #include "qset_QTime.h" 15 | #include "qset_QUrl.h" 16 | #include "qset_QUuid.h" 17 | #include "qset_bool.h" 18 | #include "qset_f32.h" 19 | #include "qset_f64.h" 20 | #include "qset_i16.h" 21 | #include "qset_i32.h" 22 | #include "qset_i64.h" 23 | #include "qset_i8.h" 24 | #include "qset_u16.h" 25 | #include "qset_u32.h" 26 | #include "qset_u64.h" 27 | #include "qset_u8.h" -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_QByteArray.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | #include 13 | using QSet_QByteArray = QSet<::QByteArray>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_QDate.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | #include 13 | using QSet_QDate = QSet<::QDate>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_QDateTime.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | #include 13 | using QSet_QDateTime = QSet<::QDateTime>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_QPersistentModelIndex.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | #include 13 | using QSet_QPersistentModelIndex = QSet<::QPersistentModelIndex>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_QString.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | #include 13 | using QSet_QString = QSet<::QString>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_QTime.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | #include 13 | using QSet_QTime = QSet<::QTime>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_QUrl.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | #include 13 | using QSet_QUrl = QSet<::QUrl>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_QUuid.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | #include 13 | using QSet_QUuid = QSet<::QUuid>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_bool.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_bool = QSet; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_f32.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_f32 = QSet; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_f64.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_f64 = QSet; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_i16.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_i16 = QSet<::std::int16_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_i32.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_i32 = QSet<::std::int32_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_i64.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_i64 = QSet; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_i8.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_i8 = QSet<::std::int8_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_u16.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_u16 = QSet<::std::uint16_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_u32.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_u32 = QSet<::std::uint32_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_u64.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_u64 = QSet<::std::uint64_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qset/qset_u8.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qset/generate.sh 10 | #pragma once 11 | #include "qset_private.h" 12 | 13 | using QSet_u8 = QSet<::std::uint8_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qsize.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #pragma once 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qsizef.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #pragma once 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qstringlist.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "rust/cxx.h" 14 | 15 | // Define namespace otherwise we hit a GCC bug 16 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 17 | namespace rust { 18 | 19 | template<> 20 | struct IsRelocatable : ::std::true_type 21 | {}; 22 | 23 | } // namespace rust 24 | 25 | namespace rust { 26 | namespace cxxqtlib1 { 27 | QStringList 28 | qstringlistFromQListQString(const QList& list); 29 | QList 30 | qstringlistAsQListQString(const QStringList& list); 31 | ::rust::isize 32 | qstringlistRemoveDuplicates(QStringList& list); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qt.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qtypes.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QByteArray.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QByteArray = QVector<::QByteArray>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QColor.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QColor = QVector<::QColor>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QDate.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QDate = QVector<::QDate>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QDateTime.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QDateTime = QVector<::QDateTime>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QLine.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QLine = QVector<::QLine>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QLineF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QLineF = QVector<::QLineF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QMargins.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QMargins = QVector<::QMargins>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QMarginsF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QMarginsF = QVector<::QMarginsF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QPersistentModelIndex.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QPersistentModelIndex = QVector<::QPersistentModelIndex>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QPoint.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QPoint = QVector<::QPoint>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QPointF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QPointF = QVector<::QPointF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QRect.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QRect = QVector<::QRect>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QRectF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QRectF = QVector<::QRectF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QSize.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QSize = QVector<::QSize>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QSizeF.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QSizeF = QVector<::QSizeF>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QString.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QString = QVector<::QString>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QTime.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QTime = QVector<::QTime>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QUrl.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QUrl = QVector<::QUrl>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QUuid.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QUuid = QVector<::QUuid>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_QVariant.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | #include 13 | using QVector_QVariant = QVector<::QVariant>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_bool.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_bool = QVector; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_f32.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_f32 = QVector; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_f64.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_f64 = QVector; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_i16.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_i16 = QVector<::std::int16_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_i32.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_i32 = QVector<::std::int32_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_i64.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_i64 = QVector; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_i8.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_i8 = QVector<::std::int8_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_u16.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_u16 = QVector<::std::uint16_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_u32.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_u32 = QVector<::std::uint32_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_u64.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_u64 = QVector<::std::uint64_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/core/qvector/qvector_u8.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | //! This is an auto-generated file. Do not edit. 9 | //! Edit instead: cxx-qt-lib/src/core/qvector/generate.sh 10 | #pragma once 11 | #include "qvector_private.h" 12 | 13 | using QVector_u8 = QVector<::std::uint8_t>; 14 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qfont.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include "rust/cxx.h" 12 | 13 | // Define namespace otherwise we hit a GCC bug 14 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 15 | namespace rust { 16 | 17 | template<> 18 | struct IsRelocatable : ::std::true_type 19 | {}; 20 | 21 | namespace cxxqtlib1 { 22 | using QFontStyle = QFont::Style; 23 | using QFontHintingPreference = QFont::HintingPreference; 24 | using QFontCapitalization = QFont::Capitalization; 25 | using QFontSpacingType = QFont::SpacingType; 26 | using QFontStyleStrategy = QFont::StyleStrategy; 27 | using QFontStyleHint = QFont::StyleHint; 28 | 29 | } // namespace cxxqtlib1 30 | } // namespace rust 31 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qimage.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Leon Matthes 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include "rust/cxx.h" 12 | 13 | #include 14 | 15 | namespace rust { 16 | 17 | // QImage has a move constructor, however it is basically trivial. 18 | template<> 19 | struct IsRelocatable : ::std::true_type 20 | {}; 21 | 22 | namespace cxxqtlib1 { 23 | using QImageFormat = QImage::Format; 24 | using QImageInvertMode = QImage::InvertMode; 25 | 26 | QImage 27 | qimageInitFromData(const rust::Slice data, 28 | rust::Str format); 29 | 30 | ::std::int64_t 31 | qimageCacheKey(const QImage& image); 32 | 33 | } // namespace cxxqtlib1 34 | } // namespace rust 35 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qpainter.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | namespace rust { 15 | namespace cxxqtlib1 { 16 | using QPainterCompositionMode = QPainter::CompositionMode; 17 | using QPainterRenderHint = QPainter::RenderHint; 18 | 19 | } // namespace cxxqtlib1 20 | } // namespace rust 21 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qpainterpath.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include "rust/cxx.h" 12 | 13 | // Define namespace otherwise we hit a GCC bug 14 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 15 | namespace rust { 16 | 17 | template<> 18 | struct IsRelocatable : ::std::true_type 19 | {}; 20 | 21 | } // namespace rust 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qpen.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include "rust/cxx.h" 12 | 13 | // Define namespace otherwise we hit a GCC bug 14 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 15 | namespace rust { 16 | 17 | template<> 18 | struct IsRelocatable : ::std::true_type 19 | {}; 20 | 21 | } // namespace rust 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qpolygon.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "rust/cxx.h" 14 | 15 | // Define namespace otherwise we hit a GCC bug 16 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 17 | namespace rust { 18 | 19 | template<> 20 | struct IsRelocatable : ::std::true_type 21 | {}; 22 | 23 | } // namespace rust 24 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qpolygonf.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "rust/cxx.h" 14 | 15 | // Define namespace otherwise we hit a GCC bug 16 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 17 | namespace rust { 18 | 19 | template<> 20 | struct IsRelocatable : ::std::true_type 21 | {}; 22 | 23 | } // namespace rust 24 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qregion.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include "rust/cxx.h" 12 | 13 | // Define namespace otherwise we hit a GCC bug 14 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 15 | namespace rust { 16 | 17 | template<> 18 | struct IsRelocatable : ::std::true_type 19 | {}; 20 | 21 | } // namespace rust 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qvector2d.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace rust { 12 | namespace cxxqtlib1 { 13 | 14 | // Qt 6 uses by-value, Qt 5 uses by-ref 15 | float 16 | qvector2DDistanceToLine(const QVector2D& vector, 17 | QVector2D point, 18 | QVector2D direction); 19 | float 20 | qvector2DDistanceToPoint(const QVector2D& vector, QVector2D point); 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qvector3d.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace rust { 12 | namespace cxxqtlib1 { 13 | 14 | // Qt 6 uses by-value, Qt 5 uses by-ref 15 | float 16 | qvector3DDistanceToLine(const QVector3D& vector, 17 | QVector3D point, 18 | QVector3D direction); 19 | float 20 | qvector3DDistanceToPlane(const QVector3D& vector, 21 | QVector3D plane, 22 | QVector3D normal); 23 | float 24 | qvector3DDistanceToPoint(const QVector3D& vector, QVector3D point); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/gui/qvector4d.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/qml/qqmlapplicationengine.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | // The definitions file is auto-generated by the build script 10 | #include 11 | 12 | #ifdef CXX_QT_QML_FEATURE 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | 19 | namespace rust { 20 | namespace cxxqtlib1 { 21 | 22 | ::std::unique_ptr 23 | qqmlapplicationengineNew(); 24 | 25 | } 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/qml/qqmlengine.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | // The definitions file is auto-generated by the build script 10 | #include 11 | 12 | #ifdef CXX_QT_QML_FEATURE 13 | 14 | #include 15 | 16 | #include 17 | 18 | namespace rust { 19 | namespace cxxqtlib1 { 20 | 21 | ::std::unique_ptr 22 | qqmlengineNew(); 23 | 24 | } 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/include/quickcontrols/qquickstyle.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Joshua Goins 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | // The definitions file is auto-generated by the build script 10 | #include 11 | 12 | #ifdef CXX_QT_QUICKCONTROLS_FEATURE 13 | 14 | #include 15 | 16 | #include 17 | 18 | namespace rust { 19 | namespace cxxqtlib1 { 20 | 21 | inline QString (*qquickstyleName)() = QQuickStyle::name; 22 | 23 | inline void (*qquickstyleSetFallbackStyle)(const QString&) = 24 | QQuickStyle::setFallbackStyle; 25 | 26 | inline void (*qquickstyleSetStyle)(const QString&) = QQuickStyle::setStyle; 27 | 28 | } 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qline.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #include "cxx-qt-lib/qline.h" 8 | 9 | #include 10 | 11 | #include 12 | 13 | // QLine has "QPoint" members - pt1, pt2 14 | // Rust represents these as 32-bit integer types. 15 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qline.h?h=v5.15.6-lts-lgpl#n90 16 | // 17 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qline.h?h=v6.2.4#n90 18 | assert_alignment_and_size(QLine, { 19 | ::std::int32_t a0; 20 | ::std::int32_t a1; 21 | ::std::int32_t a2; 22 | ::std::int32_t a3; 23 | }); 24 | 25 | static_assert(::std::is_trivially_copyable::value); 26 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qlinef.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #include "cxx-qt-lib/qlinef.h" 8 | 9 | #include 10 | 11 | #include 12 | 13 | // QLineF has "QPointF" members - pt1, pt2 14 | // Rust represents these as double types. 15 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qline.h?h=v5.15.6-lts-lgpl#n281 16 | // 17 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qline.h?h=v6.2.4#n295 18 | assert_alignment_and_size(QLineF, { 19 | double a0; 20 | double a1; 21 | double a2; 22 | double a3; 23 | }); 24 | 25 | static_assert(::std::is_trivially_copyable::value); 26 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qmargins.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #include "cxx-qt-lib/qmargins.h" 8 | 9 | #include 10 | 11 | #include 12 | 13 | // QMargins has "int" members - left, top, right, bottom 14 | // Rust represents these as 32-bit integer types. 15 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qmargins.h?h=v5.15.6-lts-lgpl#n79 16 | // 17 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qmargins.h?h=v6.2.4#n79 18 | assert_alignment_and_size(QMargins, { 19 | ::std::int32_t a0; 20 | ::std::int32_t a1; 21 | ::std::int32_t a2; 22 | ::std::int32_t a3; 23 | }); 24 | 25 | static_assert(::std::is_trivially_copyable::value); 26 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qmarginsf.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #include "cxx-qt-lib/qmarginsf.h" 8 | 9 | #include 10 | 11 | #include 12 | 13 | // QMarginsF has "qreal" members - left, top, right, bottom 14 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qmargins.h?h=v5.15.6-lts-lgpl#n314 15 | // 16 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qmargins.h?h=v6.2.4#n329 17 | assert_alignment_and_size(QMarginsF, { 18 | double a0; 19 | double a1; 20 | double a2; 21 | double a3; 22 | }); 23 | 24 | static_assert(::std::is_trivially_copyable::value); 25 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qmodelindex.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #include "cxx-qt-lib/qmodelindex.h" 8 | 9 | #include 10 | 11 | // QModelIndex has two ints, a quint pointer (same as size_t), and a pointer. 12 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/itemmodels/qabstractitemmodel.h?h=v5.15.6-lts-lgpl#n93 13 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/itemmodels/qabstractitemmodel.h?h=v6.2.4#n195 14 | assert_alignment_and_size(QModelIndex, { 15 | ::std::int32_t a0; 16 | ::std::int32_t a1; 17 | ::std::size_t a2; 18 | ::std::size_t a3; 19 | }); 20 | 21 | static_assert(::std::is_trivially_copyable::value); 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qpoint.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #include "cxx-qt-lib/qpoint.h" 9 | 10 | #include 11 | 12 | // QPoint has "int" members - xp and yp 13 | // Rust represents these as 32-bit integer types. 14 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qpoint.h?h=v5.15.6-lts-lgpl#n271 15 | // 16 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qpoint.h?h=v6.2.4#n313 17 | assert_alignment_and_size(QPoint, { 18 | ::std::int32_t a0; 19 | ::std::int32_t a1; 20 | }); 21 | 22 | static_assert(::std::is_trivially_copyable::value); 23 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qpointf.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #include "cxx-qt-lib/qpointf.h" 9 | 10 | #include 11 | 12 | // QPointF has two "qreal" members - xp and yp 13 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qpoint.h?h=v5.15.6-lts-lgpl#n271 14 | // 15 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qpoint.h?h=v6.2.4#n313 16 | assert_alignment_and_size(QPointF, { 17 | double a0; 18 | double a1; 19 | }); 20 | 21 | static_assert(::std::is_trivially_copyable::value, 22 | "QPointF should be trivially copyable"); 23 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qrectf.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #include "cxx-qt-lib/qrectf.h" 9 | 10 | #include 11 | 12 | // QRectF has 4 double members 13 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qrect.h?h=v5.15.6-lts-lgpl#n621 14 | // 15 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qrect.h?h=v6.2.4#n623 16 | assert_alignment_and_size(QRectF, { 17 | double a0; 18 | double a1; 19 | double a2; 20 | double a3; 21 | }); 22 | 23 | static_assert(::std::is_trivially_copyable::value, 24 | "QRectF must be trivially copyable"); 25 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qsize.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #include "cxx-qt-lib/qsize.h" 9 | 10 | #include 11 | 12 | #include 13 | 14 | // QSize has two "int" members 15 | // Rust represents these as 32-bit integers. 16 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qsize.h?h=v5.15.6-lts-lgpl#n104 17 | // 18 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qsize.h?h=v6.2.4#n113 19 | assert_alignment_and_size(QSize, { 20 | ::std::int32_t a0; 21 | ::std::int32_t a1; 22 | }); 23 | 24 | static_assert(::std::is_trivially_copyable::value, 25 | "QSize must be trivially copyable!"); 26 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qsizef.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Leon Matthes 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #include "cxx-qt-lib/qsizef.h" 9 | 10 | #include 11 | 12 | // QSizeF has two qreal members 13 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qsize.h?h=v5.15.6-lts-lgpl#n276 14 | // 15 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qsize.h?h=v6.2.4#n302 16 | assert_alignment_and_size(QSizeF, { 17 | double a0; 18 | double a1; 19 | }); 20 | 21 | static_assert(::std::is_trivially_copyable::value, 22 | "QSizeF must be trivially copyable!"); 23 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/core/qtypes.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #include "cxx-qt-lib/qtypes.h" 8 | 9 | #include 10 | 11 | #include "cxx-qt-lib/assertion_utils.h" 12 | 13 | assert_alignment_and_size(qint64, { ::std::int64_t a0; }); 14 | assert_alignment_and_size(qintptr, { ::std::intptr_t a0; }); 15 | assert_alignment_and_size(quint64, { ::std::uint64_t a0; }); 16 | assert_alignment_and_size(quintptr, { ::std::uintptr_t a0; }); 17 | assert_alignment_and_size(qsizetype, { ::std::size_t a0; }); 18 | // We only support qreal being a double 19 | assert_alignment_and_size(qreal, { double a0; }); 20 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/gui/init.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | extern "C" bool 14 | init_cxx_qt_lib_gui() 15 | { 16 | static std::once_flag flag; 17 | std::call_once(flag, []() { 18 | qRegisterMetaType<::QList_QColor>("QList_QColor"); 19 | qRegisterMetaType<::QVector_QColor>("QVector_QColor"); 20 | }); 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/gui/qfont.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include "cxx-qt-lib/qfont.h" 9 | 10 | #include 11 | 12 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qfont.h?h=v5.15.6-lts-lgpl#n344 13 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qfont.h?h=v6.2.4#n323 14 | assert_alignment_and_size(QFont, { 15 | ::std::size_t a0; 16 | ::std::uint32_t a1; 17 | }); // uint can be 16 or 32 but should align to at least 32 18 | 19 | static_assert(!::std::is_trivially_copy_assignable::value); 20 | static_assert(!::std::is_trivially_copy_constructible::value); 21 | 22 | static_assert(!::std::is_trivially_destructible::value); 23 | static_assert(QTypeInfo::isRelocatable); 24 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/gui/qpainter.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include "cxx-qt-lib/qpainter.h" 9 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/gui/qpen.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include "cxx-qt-lib/qpen.h" 9 | 10 | #include 11 | 12 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/painting/qpen.h?h=v5.15.6-lts-lgpl#n124 13 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/painting/qpen.h?h=v6.2.4#n94 14 | assert_alignment_and_size(QPen, { ::std::size_t a0; }); 15 | 16 | static_assert(!::std::is_trivially_copy_assignable::value); 17 | static_assert(!::std::is_trivially_copy_constructible::value); 18 | 19 | static_assert(!::std::is_trivially_destructible::value); 20 | 21 | static_assert(QTypeInfo::isRelocatable); 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/gui/qregion.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include "cxx-qt-lib/qregion.h" 9 | 10 | #include 11 | 12 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/painting/qregion.h?h=v5.15.6-lts-lgpl#n178 13 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/painting/qregion.h?h=v6.2.4#n161 14 | assert_alignment_and_size(QRegion, { ::std::size_t a0; }); 15 | 16 | static_assert(!::std::is_trivially_copy_assignable::value); 17 | static_assert(!::std::is_trivially_copy_constructible::value); 18 | 19 | static_assert(!::std::is_trivially_destructible::value); 20 | 21 | static_assert(QTypeInfo::isRelocatable); 22 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/gui/qvector4d.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include "cxx-qt-lib/qvector4d.h" 9 | 10 | #include 11 | 12 | // QVector2D has two float members - xp and yp 13 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/math3d/qvector4d.h?h=v5.15.6-lts-lgpl#n131 14 | // 15 | // https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/math3d/qvectornd.h?h=v6.2.4#n490 16 | assert_alignment_and_size(QVector4D, { 17 | float a0; 18 | float a1; 19 | float a2; 20 | float a3; 21 | }); 22 | 23 | static_assert(::std::is_trivially_copyable::value, 24 | "QVector4D should be trivially copyable"); 25 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/lib.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | #[cfg(not(any(cxxqt_qt_version_major = "5", cxxqt_qt_version_major = "6")))] 8 | compile_error!("cxxqt_qt_version_major must be either \"5\" or \"6\""); 9 | 10 | mod core; 11 | 12 | #[cfg(feature = "serde")] 13 | mod serde_impl; 14 | 15 | pub use crate::core::*; 16 | 17 | #[cfg(feature = "qt_gui")] 18 | mod gui; 19 | #[cfg(feature = "qt_gui")] 20 | pub use crate::gui::*; 21 | 22 | #[cfg(feature = "qt_qml")] 23 | mod qml; 24 | #[cfg(feature = "qt_qml")] 25 | pub use crate::qml::*; 26 | 27 | #[cfg(feature = "qt_quickcontrols")] 28 | mod quickcontrols; 29 | #[cfg(feature = "qt_quickcontrols")] 30 | pub use crate::quickcontrols::*; 31 | 32 | mod util; 33 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/qml/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | mod qqmlapplicationengine; 7 | pub use qqmlapplicationengine::QQmlApplicationEngine; 8 | 9 | mod qqmlengine; 10 | pub use qqmlengine::QQmlEngine; 11 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/qml/qqmlapplicationengine.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include "cxx-qt-lib/qqmlapplicationengine.h" 9 | 10 | namespace rust { 11 | namespace cxxqtlib1 { 12 | 13 | ::std::unique_ptr 14 | qqmlapplicationengineNew() 15 | { 16 | return ::std::make_unique(); 17 | } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/qml/qqmlengine.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include "cxx-qt-lib/qqmlengine.h" 9 | 10 | namespace rust { 11 | namespace cxxqtlib1 { 12 | 13 | ::std::unique_ptr 14 | qqmlengineNew() 15 | { 16 | return ::std::make_unique(); 17 | } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/qt_types.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | #include 9 | #include 10 | 11 | // Ensure that std::size_t is the size that Rust is expecting. 12 | // This is the same as CXX does internally 13 | // https://github.com/dtolnay/cxx/blob/5a7f93bd1361857c1bcd41f203d55f13ad0ccdf9/src/cxx.cc#L391 14 | static_assert(sizeof(::std::size_t) == sizeof(::std::uintptr_t), 15 | "unsupported size_t size"); 16 | static_assert(alignof(::std::size_t) == alignof(::std::uintptr_t), 17 | "unsupported size_t alignment"); 18 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/quickcontrols/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Joshua Goins 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | mod qquickstyle; 7 | pub use qquickstyle::QQuickStyle; 8 | -------------------------------------------------------------------------------- /crates/cxx-qt-lib/src/util.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Joshua Goins 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | /// Asserts that a boolean expression is true at compile time. 7 | /// 8 | /// See [`core::assert!`] for more information. 9 | /// 10 | /// ```compile_fail 11 | /// const_assert!(5 == 4); 12 | /// ``` 13 | #[macro_export] 14 | macro_rules! const_assert { 15 | ($x:expr $(,)?) => { 16 | const _: () = ::core::assert!($x); 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /crates/cxx-qt/README.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | # CXX-Qt 10 | 11 | CXX-Qt is a library that automatically generates code to transfer data between Rust and C++ through common interfaces 12 | such as QObjects that can be exposed directly into QML. It relies on the CXX crate internally to achieve this and thus 13 | it is recommended that any interactions with Qt that are not covered by the built-in code generators should be done 14 | directly in C++ and connected to relevant Rust logic by writing additional CXX code. The CXX-Qt build system is based 15 | on CMake, but is compatible with CXX on its own as well. 16 | -------------------------------------------------------------------------------- /crates/cxx-qt/src/qobject.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Ben Ford 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | //! QObject module 7 | 8 | #[cxx::bridge] 9 | mod ffi { 10 | unsafe extern "C++" { 11 | include!(); 12 | /// QObject type. 13 | /// 14 | /// Most methods available on this type are within the [cxx_qt_lib::core::QObjectExt] trait, 15 | /// which needs to be imported in order to access these. 16 | type QObject; 17 | 18 | #[cxx_name = "dumpObjectInfo"] 19 | /// Dump information about this QObjects name and signals 20 | fn dump_object_info(&self); 21 | } 22 | } 23 | 24 | pub use ffi::QObject; 25 | -------------------------------------------------------------------------------- /crates/qt-build-utils/src/utils.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | /// Whether apple is the current target 7 | pub(crate) fn is_apple_target() -> bool { 8 | std::env::var("TARGET") 9 | .map(|target| target.contains("apple")) 10 | .unwrap_or_else(|_| false) 11 | } 12 | 13 | /// Whether emscripten is the current target 14 | pub(crate) fn is_emscripten_target() -> bool { 15 | std::env::var("CARGO_CFG_TARGET_OS") == Ok("emscripten".to_owned()) 16 | } 17 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-FileContributor: Gerhard de Clercq 4 | # 5 | # SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | # No longer add cargo-without-cmake here. 8 | # This causes duplicate builds, as this crate is already entirely built 9 | # When using `cargo test` 10 | add_subdirectory(qml_features) 11 | add_subdirectory(qml_minimal) 12 | add_subdirectory(qml_multi_crates) 13 | 14 | # TODO: get demo_threading working for wasm builds 15 | if(NOT BUILD_WASM) 16 | add_subdirectory(demo_threading) 17 | endif() 18 | -------------------------------------------------------------------------------- /examples/cargo_without_cmake/qml: -------------------------------------------------------------------------------- 1 | ../qml_minimal/qml/ -------------------------------------------------------------------------------- /examples/cargo_without_cmake/src/cxxqt_object.rs: -------------------------------------------------------------------------------- 1 | ../../qml_minimal/rust/src/cxxqt_object.rs -------------------------------------------------------------------------------- /examples/demo_threading/images/RLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/RLogo.png -------------------------------------------------------------------------------- /examples/demo_threading/images/RLogo.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: Rust Foundation 2 | 3 | SPDX-License-Identifier: CC-BY-4.0 4 | -------------------------------------------------------------------------------- /examples/demo_threading/images/RLogolarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/RLogolarge.png -------------------------------------------------------------------------------- /examples/demo_threading/images/RLogolarge.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: Rust Foundation 2 | 3 | SPDX-License-Identifier: CC-BY-4.0 -------------------------------------------------------------------------------- /examples/demo_threading/images/activeInner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/activeInner.png -------------------------------------------------------------------------------- /examples/demo_threading/images/activeInner.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/activeOuter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/activeOuter.png -------------------------------------------------------------------------------- /examples/demo_threading/images/activeOuter.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/beach1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/beach1.png -------------------------------------------------------------------------------- /examples/demo_threading/images/beach1.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/beach2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/beach2.png -------------------------------------------------------------------------------- /examples/demo_threading/images/beach2.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/bg.png -------------------------------------------------------------------------------- /examples/demo_threading/images/bg.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/iconSensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/iconSensors.png -------------------------------------------------------------------------------- /examples/demo_threading/images/iconSensors.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/iconwirless.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/iconwirless.png -------------------------------------------------------------------------------- /examples/demo_threading/images/iconwirless.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/images.qrc.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2021, 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | SPDX-FileContributor: Nuno Pinheiro 4 | 5 | SPDX-License-Identifier: MIT OR Apache-2.0 6 | -------------------------------------------------------------------------------- /examples/demo_threading/images/inactiveInner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/inactiveInner.png -------------------------------------------------------------------------------- /examples/demo_threading/images/inactiveInner.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/inactiveOuter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/inactiveOuter.png -------------------------------------------------------------------------------- /examples/demo_threading/images/inactiveOuter.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/kdabLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/kdabLogo.png -------------------------------------------------------------------------------- /examples/demo_threading/images/kdabLogo.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: LicenseRef-KDABProprietary 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/level0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/level0.png -------------------------------------------------------------------------------- /examples/demo_threading/images/level0.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/level0i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/level0i.png -------------------------------------------------------------------------------- /examples/demo_threading/images/level0i.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/level1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/level1.png -------------------------------------------------------------------------------- /examples/demo_threading/images/level1.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/level1i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/level1i.png -------------------------------------------------------------------------------- /examples/demo_threading/images/level1i.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/level2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/level2.png -------------------------------------------------------------------------------- /examples/demo_threading/images/level2.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/level2i.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/level2i.png -------------------------------------------------------------------------------- /examples/demo_threading/images/level2i.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/level3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/level3.png -------------------------------------------------------------------------------- /examples/demo_threading/images/level3.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/ocean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/ocean.png -------------------------------------------------------------------------------- /examples/demo_threading/images/ocean.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/panel.png -------------------------------------------------------------------------------- /examples/demo_threading/images/panel.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/qt-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/qt-logo.png -------------------------------------------------------------------------------- /examples/demo_threading/images/qt-logo.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: The Qt Company 2 | 3 | SPDX-License-Identifier: LicenseRef-QtProprietary -------------------------------------------------------------------------------- /examples/demo_threading/images/rust-logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/rust-logo-white.png -------------------------------------------------------------------------------- /examples/demo_threading/images/rust-logo-white.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: Rust Foundation 2 | 3 | SPDX-License-Identifier: CC-BY-4.0 -------------------------------------------------------------------------------- /examples/demo_threading/images/sensor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/sensor.png -------------------------------------------------------------------------------- /examples/demo_threading/images/sensor.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/sensorefect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/sensorefect.png -------------------------------------------------------------------------------- /examples/demo_threading/images/sensorefect.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/images/sideshadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/demo_threading/images/sideshadow.png -------------------------------------------------------------------------------- /examples/demo_threading/images/sideshadow.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Nuno Pinheiro 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/demo_threading/qml/SideText.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | import QtQuick 2.12 6 | 7 | Text { 8 | id: sideText 9 | 10 | font.family: "Open Sans" 11 | font.italic: true 12 | font.pixelSize: 12 13 | color: "#a9deff" 14 | transformOrigin: Item.Left 15 | height: (scale * paintedHeight) 16 | opacity: (scale * scale) - 0.5 17 | 18 | Behavior on scale { 19 | NumberAnimation { 20 | duration: 570 21 | easing.type: Easing.OutQuad 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/demo_threading/qml/compat/ConicalGradientQt5.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | import QtQuick 2.12 7 | 8 | import QtGraphicalEffects 1.10 9 | 10 | ConicalGradient { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /examples/demo_threading/qml/compat/ConicalGradientQt6.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | import QtQuick 2.12 7 | 8 | import Qt5Compat.GraphicalEffects 9 | 10 | ConicalGradient { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /examples/demo_threading/qml/compat/OpacityMaskQt5.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | import QtQuick 2.12 7 | 8 | import QtGraphicalEffects 1.10 9 | 10 | OpacityMask { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /examples/demo_threading/qml/compat/OpacityMaskQt6.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | import QtQuick 2.12 7 | 8 | import Qt5Compat.GraphicalEffects 9 | 10 | OpacityMask { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /examples/demo_threading/qml/compat/compat_qt5.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | ConicalGradientQt5.qml 4 | OpacityMaskQt5.qml 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/demo_threading/qml/compat/compat_qt5.qrc.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-License-Identifier: MIT OR Apache-2.0 4 | -------------------------------------------------------------------------------- /examples/demo_threading/qml/compat/compat_qt6.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | ConicalGradientQt6.qml 4 | OpacityMaskQt6.qml 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/demo_threading/qml/compat/compat_qt6.qrc.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-License-Identifier: MIT OR Apache-2.0 4 | -------------------------------------------------------------------------------- /examples/demo_threading/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | [package] 6 | name = "cxx_qt_demo_threading" 7 | version = "0.1.0" 8 | authors = ["Andrew Hayzen "] 9 | edition = "2021" 10 | license = "MIT OR Apache-2.0" 11 | 12 | [lib] 13 | crate-type = ["staticlib"] 14 | 15 | [dependencies] 16 | async-std = "1.10" 17 | cxx.workspace = true 18 | cxx-qt.workspace = true 19 | cxx-qt-lib = { workspace = true, features = [] } 20 | futures = "0.3" 21 | futures-timer = "3.0" 22 | serde.workspace = true 23 | serde_json.workspace = true 24 | uuid = { version = "1.2", features = ["serde"] } 25 | 26 | [build-dependencies] 27 | cxx-qt-build.workspace = true 28 | 29 | [features] 30 | link_qt_object_files = [ "cxx-qt-build/link_qt_object_files" ] 31 | -------------------------------------------------------------------------------- /examples/demo_threading/rust/src/network/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021, 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Leon Matthes 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | mod request; 8 | mod response; 9 | mod server; 10 | 11 | pub use server::{NetworkChannel, NetworkServer}; 12 | -------------------------------------------------------------------------------- /examples/demo_threading/rust/src/workers/mod.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021, 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Leon Matthes 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | mod accumulator; 8 | mod sensors; 9 | mod timeout; 10 | 11 | pub use accumulator::AccumulatorWorker; 12 | pub use sensors::{SensorHashMap, SensorsWorker}; 13 | pub use timeout::TimeoutWorker; 14 | -------------------------------------------------------------------------------- /examples/qml_basics/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Leon Matthes 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | [package] 7 | name = "cxx-qt-basics" 8 | version = "0.1.0" 9 | edition = "2021" 10 | authors = [ 11 | "Leon Matthes " 12 | ] 13 | 14 | [dependencies] 15 | cxx.workspace = true 16 | cxx-qt.workspace = true 17 | cxx-qt-lib = { workspace = true, features = [ "full" ] } 18 | 19 | [build-dependencies] 20 | cxx-qt-build = { workspace = true, features= [ "link_qt_object_files" ] } 21 | -------------------------------------------------------------------------------- /examples/qml_basics/build.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Leon Matthes 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | // 6 | use cxx_qt_build::{CxxQtBuilder, QmlModule}; 7 | fn main() { 8 | CxxQtBuilder::new() 9 | .qml_module(QmlModule { 10 | uri: "com.kdab.tutorial", 11 | qml_files: &["qml/main.qml"], 12 | rust_files: &["src/main.rs"], 13 | ..Default::default() 14 | }) 15 | .qt_module("Network") 16 | .build(); 17 | } 18 | -------------------------------------------------------------------------------- /examples/qml_features/cpp/custom_object.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #include "custom_object.h" 8 | 9 | bool 10 | qvariantCanConvertCustomStruct(const QVariant& variant) 11 | { 12 | return variant.canConvert(); 13 | } 14 | 15 | CustomObject::CustomObject(QObject* parent) 16 | : QObject(parent) 17 | , m_value(0) 18 | { 19 | } 20 | 21 | CustomStruct 22 | CustomObject::asStruct() const 23 | { 24 | return CustomStruct{ m_value }; 25 | } 26 | -------------------------------------------------------------------------------- /examples/qml_features/cpp/custom_object.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | struct CustomStruct 13 | { 14 | int value; 15 | }; 16 | Q_DECLARE_METATYPE(CustomStruct); 17 | 18 | bool 19 | qvariantCanConvertCustomStruct(const QVariant& variant); 20 | 21 | class CustomObject : public QObject 22 | { 23 | Q_OBJECT 24 | 25 | Q_PROPERTY(int value MEMBER m_value) 26 | public: 27 | explicit CustomObject(QObject* parent = nullptr); 28 | 29 | Q_INVOKABLE CustomStruct asStruct() const; 30 | 31 | private: 32 | int m_value; 33 | }; 34 | -------------------------------------------------------------------------------- /examples/qml_features/cpp/external_qobject.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #include "external_qobject.h" 8 | 9 | ExternalQObject::ExternalQObject(QObject* parent) 10 | : QObject(parent) 11 | { 12 | } 13 | 14 | void 15 | ExternalQObject::trigger(::std::uint32_t amount) 16 | { 17 | for (::std::uint32_t i = 0; i < amount; i++) { 18 | Q_EMIT triggered(); 19 | Q_EMIT triggeredPrivateSignal(QPrivateSignal()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/qml_features/cpp/external_qobject.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | 11 | #include 12 | 13 | class ExternalQObject : public QObject 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit ExternalQObject(QObject* parent = nullptr); 19 | 20 | Q_INVOKABLE void trigger(::std::uint32_t amount); 21 | 22 | Q_SIGNALS: 23 | void triggered(); 24 | void triggeredPrivateSignal(QPrivateSignal); 25 | }; 26 | -------------------------------------------------------------------------------- /examples/qml_features/qml/images/images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | red.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/qml_features/qml/images/images.qrc.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/qml_features/qml/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/qml_features/qml/images/red.png -------------------------------------------------------------------------------- /examples/qml_features/qml/images/red.png.license: -------------------------------------------------------------------------------- 1 | SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | SPDX-FileContributor: Andrew Hayzen 3 | 4 | SPDX-License-Identifier: MIT OR Apache-2.0 5 | -------------------------------------------------------------------------------- /examples/qml_features/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-FileContributor: Gerhard de Clercq 4 | # 5 | # SPDX-License-Identifier: MIT OR Apache-2.0 6 | [package] 7 | name = "qml_features" 8 | version = "0.1.0" 9 | authors = ["Andrew Hayzen ", "Gerhard de Clercq "] 10 | edition = "2021" 11 | license = "MIT OR Apache-2.0" 12 | 13 | [lib] 14 | crate-type = ["staticlib"] 15 | 16 | [dependencies] 17 | cxx.workspace = true 18 | cxx-qt.workspace = true 19 | cxx-qt-lib = { workspace = true, features = ["qt_gui", "qt_qml", "serde"] } 20 | serde.workspace = true 21 | serde_json.workspace = true 22 | 23 | [build-dependencies] 24 | cxx-qt-build.workspace = true 25 | 26 | [features] 27 | link_qt_object_files = [ "cxx-qt-build/link_qt_object_files" ] 28 | -------------------------------------------------------------------------------- /examples/qml_features/rust/src/empty.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDAB/cxx-qt/96d323343fc8b59617e8902aa6f61360634d5a62/examples/qml_features/rust/src/empty.rs -------------------------------------------------------------------------------- /examples/qml_features/rust/src/empty_bridge.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Alessandro Ambrosano 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | //! This example implements an empty bridge, and it's used as a corner case to test 7 | //! the build procedure 8 | /// An empty CXX-Qt bridge 9 | #[cxx_qt::bridge] 10 | pub mod qobject { 11 | } 12 | -------------------------------------------------------------------------------- /examples/qml_features/rust/src/lib.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | // Use this crate to test that missing_docs works with our generated code 8 | #![deny(missing_docs)] 9 | 10 | //! This example provides demonstrations of most of the features of CXX-Qt 11 | //! split into separate modules 12 | 13 | pub mod containers; 14 | pub mod custom_base_class; 15 | pub mod custom_parent_class; 16 | pub mod externcxxqt; 17 | pub mod invokables; 18 | pub mod multiple_qobjects; 19 | pub mod naming; 20 | pub mod nested_qobjects; 21 | pub mod properties; 22 | pub mod serialisation; 23 | pub mod signals; 24 | pub mod singleton; 25 | pub mod threading; 26 | pub mod types; 27 | pub mod uncreatable; 28 | -------------------------------------------------------------------------------- /examples/qml_features/rust/src/uncreatable.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | //! This example shows how a QML_UNCREATABLE QObject can be used 7 | 8 | /// A CXX-Qt bridge which shows how a QML_UNCREATABLE QObject can be used 9 | // ANCHOR: book_macro_code 10 | #[cxx_qt::bridge] 11 | pub mod ffi { 12 | extern "RustQt" { 13 | #[qobject] 14 | #[qml_element] 15 | #[qml_uncreatable] 16 | #[qproperty(i32, value)] 17 | type RustUncreatable = super::RustUncreatableRust; 18 | } 19 | } 20 | 21 | /// A QObject which is a QML_UNCREATABLE 22 | #[derive(Default)] 23 | pub struct RustUncreatableRust { 24 | /// A value Q_PROPERTY 25 | value: i32, 26 | } 27 | -------------------------------------------------------------------------------- /examples/qml_features/tests/tst_custom_parent_class.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | import QtQuick 2.12 6 | import QtTest 1.12 7 | 8 | import com.kdab.cxx_qt.demo 1.0 9 | 10 | TestCase { 11 | name: "CustomParentClassTests" 12 | 13 | Component { 14 | id: componentCustomParentClass 15 | 16 | CustomParentClass { 17 | 18 | } 19 | } 20 | 21 | function test_create() { 22 | const item = createTemporaryObject(componentCustomParentClass, null, {}); 23 | verify(item !== null); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /examples/qml_features/tests/tst_invokables.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | import QtQuick 2.12 6 | import QtTest 1.12 7 | 8 | import com.kdab.cxx_qt.demo 1.0 9 | 10 | TestCase { 11 | name: "InvokablesTests" 12 | 13 | readonly property color kdabColor: "#0077C8" 14 | readonly property color orangeColor: "#ff8000" 15 | 16 | Component { 17 | id: componentInvokables 18 | 19 | RustInvokables { 20 | 21 | } 22 | } 23 | 24 | function test_store_load() { 25 | const obj = createTemporaryObject(componentInvokables, null, {}); 26 | compare(obj.loadColor(), kdabColor); 27 | 28 | obj.storeColor(1.0, 0.5, 0.0); 29 | compare(obj.loadColor(), orangeColor); 30 | 31 | obj.reset(); 32 | compare(obj.loadColor(), kdabColor); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /examples/qml_features/tests/tst_naming.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Ben Ford 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | import QtQuick 2.12 6 | import QtTest 1.12 7 | 8 | import com.kdab.cxx_qt.demo 1.0 9 | 10 | TestCase { 11 | name: "NamingTests" 12 | 13 | Component { 14 | id: componentNaming 15 | 16 | RenamedObject { 17 | 18 | } 19 | } 20 | 21 | function test_increment() { 22 | const obj = createTemporaryObject(componentNaming, null, {}); 23 | 24 | compare(obj.numberProp, 0); 25 | obj.increment(); 26 | compare(obj.numberProp, 1); 27 | compare(obj.getNum(), 42); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/qml_features/tests/tst_singleton.qml: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | import QtQuick 2.12 6 | import QtTest 1.12 7 | 8 | import com.kdab.cxx_qt.demo 1.0 9 | 10 | TestCase { 11 | name: "SingletonTests" 12 | 13 | function test_increment() { 14 | compare(RustSingleton.persistentValue, 0); 15 | RustSingleton.increment(); 16 | compare(RustSingleton.persistentValue, 1); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/qml_minimal/rust/build.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | // ANCHOR: book_build_rs 8 | use cxx_qt_build::{CxxQtBuilder, QmlModule}; 9 | 10 | fn main() { 11 | CxxQtBuilder::new() 12 | // ANCHOR: book_qml_module 13 | .qml_module(QmlModule { 14 | uri: "com.kdab.cxx_qt.demo", 15 | rust_files: &["src/cxxqt_object.rs"], 16 | qml_files: &["../qml/main.qml"], 17 | ..Default::default() 18 | }) 19 | // ANCHOR_END: book_qml_module 20 | .build(); 21 | } 22 | // ANCHOR_END: book_build_rs 23 | -------------------------------------------------------------------------------- /examples/qml_minimal/rust/src/lib.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Be Wilson 3 | // SPDX-FileContributor: Andrew Hayzen 4 | // SPDX-FileContributor: Gerhard de Clercq 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | // ANCHOR: book_mod_statement 9 | pub mod cxxqt_object; 10 | // ANCHOR_END: book_mod_statement 11 | -------------------------------------------------------------------------------- /examples/qml_minimal/tests/myobject/tst_myobject.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Gerhard de Clercq 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #include 9 | #include 10 | #include 11 | 12 | class Setup : public QObject 13 | { 14 | Q_OBJECT 15 | }; 16 | 17 | QUICK_TEST_MAIN_WITH_SETUP(myobject, Setup) 18 | 19 | #include "tst_myobject.moc" 20 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/cpp/main.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #include 8 | #include 9 | 10 | int 11 | main(int argc, char* argv[]) 12 | { 13 | QGuiApplication app(argc, argv); 14 | 15 | QQmlApplicationEngine engine; 16 | 17 | const QUrl url( 18 | QStringLiteral("qrc:/qt/qml/com/kdab/cxx_qt/demo/qml/main.qml")); 19 | QObject::connect( 20 | &engine, 21 | &QQmlApplicationEngine::objectCreated, 22 | &app, 23 | [url](QObject* obj, const QUrl& objUrl) { 24 | if (!obj && url == objUrl) 25 | QCoreApplication::exit(-1); 26 | }, 27 | Qt::QueuedConnection); 28 | 29 | engine.load(url); 30 | 31 | return app.exec(); 32 | } 33 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/rust/main/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | [package] 6 | name = "qml_multi_crates" 7 | version = "0.1.0" 8 | authors = ["Andrew Hayzen "] 9 | edition = "2021" 10 | license = "MIT OR Apache-2.0" 11 | 12 | [lib] 13 | crate-type = ["staticlib", "lib"] 14 | 15 | [dependencies] 16 | sub1 = { path = "../sub1" } 17 | sub2 = { path = "../sub2" } 18 | 19 | cxx.workspace = true 20 | cxx-qt.workspace = true 21 | cxx-qt-lib = { workspace = true, features = [ "qt_full" ] } 22 | 23 | [build-dependencies] 24 | cxx-qt-build.workspace = true 25 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/rust/main/build.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_build::{CxxQtBuilder, QmlModule}; 7 | 8 | fn main() { 9 | CxxQtBuilder::new() 10 | .qt_module("Network") 11 | .qml_module(QmlModule { 12 | uri: "com.kdab.cxx_qt.demo", 13 | rust_files: &["src/main_object.rs"], 14 | qml_files: &["../../qml/main.qml"], 15 | ..Default::default() 16 | }) 17 | .build(); 18 | } 19 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/rust/main/src/lib.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | mod main_object; 7 | 8 | // Ensure the symbols from the rlib dependencies end up 9 | // in the staticlib (if you use Rust symbols from these 10 | // crates in this crate, you can skip these `extern crate` statements). 11 | extern crate sub1; 12 | extern crate sub2; 13 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/rust/sub1/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | [package] 6 | name = "sub1" 7 | version = "0.1.0" 8 | authors = [ 9 | "Andrew Hayzen ", 10 | ] 11 | edition = "2021" 12 | license = "MIT OR Apache-2.0" 13 | 14 | links = "sub1" 15 | 16 | [dependencies] 17 | cxx.workspace = true 18 | cxx-qt.workspace = true 19 | cxx-qt-lib.workspace = true 20 | 21 | [build-dependencies] 22 | cxx-qt-build.workspace = true 23 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/rust/sub1/build.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_build::{CxxQtBuilder, Interface, QmlModule}; 7 | 8 | fn main() { 9 | let interface = Interface::default(); 10 | CxxQtBuilder::library(interface) 11 | .qt_module("Network") 12 | .qml_module(QmlModule::<_, &str> { 13 | uri: "com.kdab.cxx_qt.demo.sub1", 14 | rust_files: &["src/sub1_object.rs"], 15 | ..Default::default() 16 | }) 17 | .build(); 18 | } 19 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/rust/sub1/src/lib.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | // We need to enable packed bundled libs to allow for +bundle and +whole-archive 7 | // https://github.com/rust-lang/rust/issues/108081 8 | 9 | mod sub1_object; 10 | 11 | pub fn increment(number: u32) -> u32 { 12 | number + 2 13 | } 14 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/rust/sub2/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | [package] 6 | name = "sub2" 7 | version = "0.1.0" 8 | authors = [ 9 | "Andrew Hayzen ", 10 | ] 11 | edition = "2021" 12 | license = "MIT OR Apache-2.0" 13 | 14 | links = "sub2" 15 | 16 | [dependencies] 17 | cxx.workspace = true 18 | cxx-qt.workspace = true 19 | cxx-qt-lib.workspace = true 20 | 21 | [build-dependencies] 22 | cxx-qt-build.workspace = true 23 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/rust/sub2/build.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_build::{CxxQtBuilder, Interface, QmlModule}; 7 | 8 | fn main() { 9 | let interface = Interface::default(); 10 | CxxQtBuilder::library(interface) 11 | .qml_module(QmlModule::<_, &str> { 12 | uri: "com.kdab.cxx_qt.demo.sub2", 13 | rust_files: &["src/sub2_object.rs"], 14 | ..Default::default() 15 | }) 16 | .build(); 17 | } 18 | -------------------------------------------------------------------------------- /examples/qml_multi_crates/rust/sub2/src/lib.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | // We need to enable packed bundled libs to allow for +bundle and +whole-archive 7 | // https://github.com/rust-lang/rust/issues/108081 8 | 9 | mod sub2_object; 10 | 11 | pub fn increment(number: u32) -> u32 { 12 | number + 3 13 | } 14 | -------------------------------------------------------------------------------- /examples/todo_app/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Leon Matthes 3 | # 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | [package] 7 | name = "cxx-qt-todo-app" 8 | version = "0.1.0" 9 | edition = "2021" 10 | 11 | [dependencies] 12 | cxx.workspace = true 13 | cxx-qt.workspace = true 14 | cxx-qt-lib = { workspace = true, features = ["full"] } 15 | 16 | [build-dependencies] 17 | cxx-qt-build = { workspace = true, features = ["link_qt_object_files"] } 18 | -------------------------------------------------------------------------------- /examples/todo_app/build.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Leon Matthes 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_build::{CxxQtBuilder, QmlModule}; 7 | fn main() { 8 | CxxQtBuilder::new() 9 | .qml_module(QmlModule { 10 | uri: "com.kdab.todo", 11 | qml_files: &["qml/main.qml"], 12 | rust_files: &["src/todo_list.rs"], 13 | ..Default::default() 14 | }) 15 | .qt_module("Network") 16 | .build(); 17 | } 18 | -------------------------------------------------------------------------------- /examples/todo_app/src/main.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Leon Matthes 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | mod todo_list; 7 | 8 | use cxx_qt_lib::{QGuiApplication, QQmlApplicationEngine, QUrl}; 9 | 10 | fn main() { 11 | let mut app = QGuiApplication::new(); 12 | let mut engine = QQmlApplicationEngine::new(); 13 | 14 | if let Some(engine) = engine.as_mut() { 15 | engine.load(&QUrl::from("qrc:/qt/qml/com/kdab/todo/qml/main.qml")); 16 | } 17 | 18 | if let Some(app) = app.as_mut() { 19 | app.exec(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /scripts/clang_format_check.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 4 | # SPDX-FileContributor: Andrew Hayzen 5 | # SPDX-FileContributor: Gerhard de Clercq 6 | # 7 | # SPDX-License-Identifier: MIT OR Apache-2.0 8 | set -e 9 | 10 | CLANG_FORMAT_CMD=$1 11 | DIR=$2 12 | echo "Executing $CLANG_FORMAT_CMD on directory: $DIR" 13 | 14 | function clang_format_files() { 15 | while IFS= read -r -d '' FILE 16 | do 17 | if git ls-files --error-unmatch "$FILE" &> /dev/null; then 18 | $CLANG_FORMAT_CMD --dry-run -Werror "$FILE" 19 | RET=$((RET | $?)) 20 | fi 21 | done < <(find "$DIR" -type f -name "$1" -a -print0) 22 | } 23 | 24 | clang_format_files "*.cpp" 25 | clang_format_files "*.h" 26 | -------------------------------------------------------------------------------- /scripts/clang_format_inplace.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 4 | # SPDX-FileContributor: Andrew Hayzen 5 | # 6 | # SPDX-License-Identifier: MIT OR Apache-2.0 7 | 8 | CLANG_FORMAT_CMD=$1 9 | DIR=$2 10 | echo "Executing $CLANG_FORMAT_CMD on directory: $DIR" 11 | 12 | function clang_format_files() { 13 | while IFS= read -r -d '' FILE 14 | do 15 | if git ls-files --error-unmatch "$FILE" &> /dev/null; then 16 | $CLANG_FORMAT_CMD -i -Werror "$FILE" 17 | fi 18 | done < <(find "$DIR" -type f -name "$1" -a -print0) 19 | } 20 | 21 | clang_format_files "*.cpp" 22 | clang_format_files "*.h" 23 | -------------------------------------------------------------------------------- /tests/basic_cxx_only/cpp/cxx_test.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Gerhard de Clercq 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | 9 | #include "cxx_test.h" 10 | 11 | namespace { 12 | int hidden_num = 100; 13 | } 14 | 15 | int 16 | get_cpp_number() 17 | { 18 | return hidden_num; 19 | } 20 | 21 | void 22 | set_cpp_number(int num) 23 | { 24 | hidden_num = num; 25 | } 26 | -------------------------------------------------------------------------------- /tests/basic_cxx_only/cpp/cxx_test.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Gerhard de Clercq 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #pragma once 9 | 10 | int 11 | get_cpp_number(); 12 | 13 | void 14 | set_cpp_number(int num); 15 | -------------------------------------------------------------------------------- /tests/basic_cxx_only/cpp/main.cpp: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // SPDX-FileContributor: Gerhard de Clercq 6 | // 7 | // SPDX-License-Identifier: MIT OR Apache-2.0 8 | #include 9 | 10 | #include "basic_cxx_only/src/lib.cxx.h" 11 | #include "cxx_test.h" 12 | 13 | class CxxTest : public QObject 14 | { 15 | Q_OBJECT 16 | 17 | private Q_SLOTS: 18 | // Clean cxx allows basic interaction between C++ and Rust 19 | void test_cxx_interaction() 20 | { 21 | QCOMPARE(get_numbers_sum(), 102); 22 | set_cpp_number(200); 23 | QCOMPARE(get_numbers_sum(), 202); 24 | } 25 | }; 26 | 27 | QTEST_MAIN(CxxTest) 28 | #include "main.moc" 29 | -------------------------------------------------------------------------------- /tests/basic_cxx_only/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-FileContributor: Gerhard de Clercq 4 | # 5 | # SPDX-License-Identifier: MIT OR Apache-2.0 6 | [package] 7 | name = "basic_cxx_only" 8 | version = "0.1.0" 9 | authors = ["Andrew Hayzen ", "Gerhard de Clercq "] 10 | edition.workspace = true 11 | license = "MIT OR Apache-2.0" 12 | 13 | [lib] 14 | crate-type = ["staticlib"] 15 | 16 | [dependencies] 17 | cxx.workspace = true 18 | 19 | [build-dependencies] 20 | cxx-qt-build.workspace = true 21 | -------------------------------------------------------------------------------- /tests/basic_cxx_only/rust/build.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | use cxx_qt_build::CxxQtBuilder; 7 | 8 | fn main() { 9 | CxxQtBuilder::new() 10 | .file("src/lib.rs") 11 | .cc_builder(|cc| { 12 | cc.include("../cpp"); 13 | // cxx_test.cpp need to be compiled by cargo rather than CMakeLists.txt, 14 | // otherwise linking cargo tests fails because the symbols from those files are not found. 15 | // This to make cargo only tests work. 16 | cc.file("../cpp/cxx_test.cpp"); 17 | }) 18 | .build(); 19 | } 20 | -------------------------------------------------------------------------------- /tests/basic_cxx_only/rust/src/lib.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | #[cxx::bridge] 7 | mod ffi { 8 | unsafe extern "C++" { 9 | include!("cxx_test.h"); 10 | 11 | fn get_cpp_number() -> i32; 12 | } 13 | 14 | extern "Rust" { 15 | fn get_numbers_sum() -> i32; 16 | } 17 | } 18 | 19 | fn get_numbers_sum() -> i32 { 20 | ffi::get_cpp_number() + 2 21 | } 22 | 23 | #[cfg(test)] 24 | mod tests { 25 | use super::ffi::get_cpp_number; 26 | 27 | #[test] 28 | fn test_get_numbers_sum() { 29 | assert_eq!(get_cpp_number(), 100); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/basic_cxx_qt/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-FileContributor: Gerhard de Clercq 4 | # 5 | # SPDX-License-Identifier: MIT OR Apache-2.0 6 | [package] 7 | name = "basic_cxx_qt" 8 | version = "0.1.0" 9 | authors = ["Andrew Hayzen ", "Gerhard de Clercq "] 10 | edition.workspace = true 11 | license = "MIT OR Apache-2.0" 12 | 13 | [lib] 14 | crate-type = ["staticlib"] 15 | 16 | [dependencies] 17 | cxx.workspace = true 18 | cxx-qt.workspace = true 19 | cxx-qt-lib = { workspace = true } 20 | serde = { version = "1.0", features = ["derive"] } 21 | serde_json = "1.0" 22 | 23 | [build-dependencies] 24 | cxx-qt-build.workspace = true 25 | -------------------------------------------------------------------------------- /tests/basic_cxx_qt/rust/build.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | use cxx_qt_build::CxxQtBuilder; 7 | 8 | fn main() { 9 | CxxQtBuilder::new() 10 | .file("src/empty.rs") 11 | .file("src/data.rs") 12 | .file("src/lib.rs") 13 | .file("src/types.rs") 14 | .file("src/naming.rs") 15 | .build(); 16 | } 17 | -------------------------------------------------------------------------------- /tests/basic_cxx_qt/rust/src/empty.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | #[cxx_qt::bridge] 7 | mod ffi { 8 | extern "RustQt" { 9 | #[qobject] 10 | type Empty = super::EmptyRust; 11 | } 12 | } 13 | 14 | #[derive(Default)] 15 | pub struct EmptyRust; 16 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/cpp/qpen.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "qt_types_standalone/src/qpen.cxx.h" 13 | 14 | class QPenTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void construct() 20 | { 21 | const auto p = construct_qpen(); 22 | QCOMPARE(p.style(), Qt::SolidLine); 23 | QCOMPARE(p.width(), 1); 24 | } 25 | 26 | void clone() 27 | { 28 | auto p = QPen(Qt::DashLine); 29 | p.setWidth(5); 30 | const auto c = clone_qpen(p); 31 | QCOMPARE(c.style(), Qt::DashLine); 32 | QCOMPARE(c.color(), Qt::black); 33 | QCOMPARE(c.width(), 5); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/cpp/qpoint.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "qt_types_standalone/src/qpoint.cxx.h" 13 | 14 | class QPointTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void construct() 20 | { 21 | const auto p = construct_qpoint(); 22 | QCOMPARE(p.x(), 2); 23 | QCOMPARE(p.y(), 4); 24 | } 25 | 26 | void read() 27 | { 28 | const auto p = QPoint(2, 4); 29 | QVERIFY(read_qpoint(p)); 30 | } 31 | 32 | void clone() 33 | { 34 | const auto p = QPoint(2, 4); 35 | const auto c = clone_qpoint(p); 36 | QCOMPARE(c.x(), 2); 37 | QCOMPARE(c.y(), 4); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/cpp/qpointf.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "qt_types_standalone/src/qpointf.cxx.h" 13 | 14 | class QPointFTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void construct() 20 | { 21 | const auto p = construct_qpointf(); 22 | QCOMPARE(p.x(), 1.23); 23 | QCOMPARE(p.y(), 4.56); 24 | } 25 | 26 | void read() 27 | { 28 | const auto p = QPointF(1.23, 4.56); 29 | QVERIFY(read_qpointf(p)); 30 | } 31 | 32 | void clone() 33 | { 34 | const auto p = QPointF(1.23, 4.56); 35 | const auto c = clone_qpointf(p); 36 | QCOMPARE(c.x(), 1.23); 37 | QCOMPARE(c.y(), 4.56); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/cpp/qregion.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Laurent Montel 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "qt_types_standalone/src/qregion.cxx.h" 13 | 14 | class QRegionTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void construct() 20 | { 21 | const auto p = construct_qregion(); 22 | QVERIFY(p.isEmpty()); 23 | } 24 | 25 | void clone() 26 | { 27 | const auto p = QRegion(2, 4, 5, 3); 28 | const auto c = clone_qregion(p); 29 | QCOMPARE(p, c); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/cpp/qsize.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "qt_types_standalone/src/qsize.cxx.h" 13 | 14 | class QSizeTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void construct() 20 | { 21 | const auto s = construct_qsize(); 22 | QCOMPARE(s.width(), 1); 23 | QCOMPARE(s.height(), 4); 24 | } 25 | 26 | void read() 27 | { 28 | const auto s = QSize(1, 4); 29 | QVERIFY(read_qsize(s)); 30 | } 31 | 32 | void clone() 33 | { 34 | const auto s = QSize(1, 4); 35 | const auto c = clone_qsize(s); 36 | QCOMPARE(c.width(), 1); 37 | QCOMPARE(c.height(), 4); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/cpp/qsizef.h: -------------------------------------------------------------------------------- 1 | // clang-format off 2 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 3 | // clang-format on 4 | // SPDX-FileContributor: Andrew Hayzen 5 | // 6 | // SPDX-License-Identifier: MIT OR Apache-2.0 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "qt_types_standalone/src/qsizef.cxx.h" 13 | 14 | class QSizeFTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void construct() 20 | { 21 | const auto s = construct_qsizef(); 22 | QCOMPARE(s.width(), 1.23); 23 | QCOMPARE(s.height(), 4.56); 24 | } 25 | 26 | void read() 27 | { 28 | const auto s = QSizeF(1.23, 4.56); 29 | QVERIFY(read_qsizef(s)); 30 | } 31 | 32 | void clone() 33 | { 34 | const auto s = QSizeF(1.23, 4.56); 35 | const auto c = clone_qsizef(s); 36 | QCOMPARE(c.width(), 1.23); 37 | QCOMPARE(c.height(), 4.56); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-FileContributor: Gerhard de Clercq 4 | # 5 | # SPDX-License-Identifier: MIT OR Apache-2.0 6 | [package] 7 | name = "qt_types_standalone" 8 | version = "0.1.0" 9 | authors = ["Andrew Hayzen ", "Gerhard de Clercq "] 10 | edition.workspace = true 11 | license = "MIT OR Apache-2.0" 12 | 13 | [lib] 14 | crate-type = ["staticlib"] 15 | 16 | [dependencies] 17 | cxx.workspace = true 18 | cxx-qt-gen.workspace = true 19 | cxx-qt-lib = { workspace = true, features = ["qt_gui", "qt_qml"] } 20 | 21 | [build-dependencies] 22 | cxx-qt-build.workspace = true 23 | qt-build-utils.workspace = true 24 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qdate.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | use cxx_qt_lib::QDate; 8 | 9 | #[cxx::bridge] 10 | mod qdate_cxx { 11 | unsafe extern "C++" { 12 | include!("cxx-qt-lib/qdate.h"); 13 | type QDate = cxx_qt_lib::QDate; 14 | } 15 | 16 | extern "Rust" { 17 | fn construct_qdate() -> QDate; 18 | fn read_qdate(d: &QDate) -> bool; 19 | fn clone_qdate(d: &QDate) -> QDate; 20 | } 21 | } 22 | 23 | fn construct_qdate() -> QDate { 24 | QDate::new(2022, 1, 1) 25 | } 26 | 27 | fn read_qdate(d: &QDate) -> bool { 28 | d.year() == 2022 && d.month() == 1 && d.day() == 1 29 | } 30 | 31 | fn clone_qdate(d: &QDate) -> QDate { 32 | d.clone() 33 | } 34 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qline.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Laurent Montel 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_lib::{QLine, QPoint}; 7 | 8 | #[cxx::bridge] 9 | mod qline_cxx { 10 | unsafe extern "C++" { 11 | include!("cxx-qt-lib/qline.h"); 12 | type QLine = cxx_qt_lib::QLine; 13 | } 14 | 15 | extern "Rust" { 16 | fn construct_qline() -> QLine; 17 | fn read_qline(m: &QLine) -> bool; 18 | fn clone_qline(m: &QLine) -> QLine; 19 | } 20 | } 21 | 22 | fn construct_qline() -> QLine { 23 | QLine::new(QPoint::new(1, 2), QPoint::new(3, 4)) 24 | } 25 | 26 | fn read_qline(m: &QLine) -> bool { 27 | m.x1() == 1 && m.y1() == 2 && m.x2() == 3 && m.y2() == 4 28 | } 29 | 30 | fn clone_qline(m: &QLine) -> QLine { 31 | m.clone() 32 | } 33 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qlinef.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Laurent Montel 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_lib::{QLineF, QPointF}; 7 | 8 | #[cxx::bridge] 9 | mod qlinef_cxx { 10 | unsafe extern "C++" { 11 | include!("cxx-qt-lib/qlinef.h"); 12 | type QLineF = cxx_qt_lib::QLineF; 13 | } 14 | 15 | extern "Rust" { 16 | fn construct_qlinef() -> QLineF; 17 | fn read_qlinef(m: &QLineF) -> bool; 18 | fn clone_qlinef(m: &QLineF) -> QLineF; 19 | } 20 | } 21 | 22 | fn construct_qlinef() -> QLineF { 23 | QLineF::new(QPointF::new(1.0, 2.0), QPointF::new(3.0, 4.0)) 24 | } 25 | 26 | fn read_qlinef(m: &QLineF) -> bool { 27 | m.x1() == 1.0 && m.y1() == 2.0 && m.x2() == 3.0 && m.y2() == 4.0 28 | } 29 | 30 | fn clone_qlinef(m: &QLineF) -> QLineF { 31 | m.clone() 32 | } 33 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qpen.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Laurent Montel 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_lib::QPen; 7 | 8 | #[cxx::bridge] 9 | mod qpen_cxx { 10 | unsafe extern "C++" { 11 | include!("cxx-qt-lib/qpen.h"); 12 | 13 | type QPen = cxx_qt_lib::QPen; 14 | } 15 | 16 | extern "Rust" { 17 | fn construct_qpen() -> QPen; 18 | fn clone_qpen(p: &QPen) -> QPen; 19 | } 20 | } 21 | 22 | fn construct_qpen() -> QPen { 23 | QPen::default() 24 | } 25 | 26 | fn clone_qpen(p: &QPen) -> QPen { 27 | p.clone() 28 | } 29 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qpoint.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | use cxx_qt_lib::QPoint; 8 | 9 | #[cxx::bridge] 10 | mod qpoint_cxx { 11 | unsafe extern "C++" { 12 | include!("cxx-qt-lib/qpoint.h"); 13 | 14 | type QPoint = cxx_qt_lib::QPoint; 15 | } 16 | 17 | extern "Rust" { 18 | fn construct_qpoint() -> QPoint; 19 | fn read_qpoint(p: &QPoint) -> bool; 20 | fn clone_qpoint(p: &QPoint) -> QPoint; 21 | } 22 | } 23 | 24 | fn construct_qpoint() -> QPoint { 25 | QPoint::new(2, 4) 26 | } 27 | 28 | fn read_qpoint(p: &QPoint) -> bool { 29 | p.x() == 2 && p.y() == 4 30 | } 31 | 32 | fn clone_qpoint(p: &QPoint) -> QPoint { 33 | p.clone() 34 | } 35 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qpolygon.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Laurent Montel 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_lib::QPolygon; 7 | 8 | #[cxx::bridge] 9 | mod qpolygon_cxx { 10 | unsafe extern "C++" { 11 | include!("cxx-qt-lib/qpolygon.h"); 12 | 13 | type QPolygon = cxx_qt_lib::QPolygon; 14 | } 15 | 16 | extern "Rust" { 17 | fn clone_qpolygon(p: &QPolygon) -> QPolygon; 18 | fn construct_qpolygon() -> QPolygon; 19 | } 20 | } 21 | 22 | fn construct_qpolygon() -> QPolygon { 23 | QPolygon::default() 24 | } 25 | 26 | fn clone_qpolygon(p: &QPolygon) -> QPolygon { 27 | p.clone() 28 | } 29 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qpolygonf.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Laurent Montel 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_lib::QPolygonF; 7 | 8 | #[cxx::bridge] 9 | mod qpolygonf_cxx { 10 | unsafe extern "C++" { 11 | include!("cxx-qt-lib/qpolygonf.h"); 12 | 13 | type QPolygonF = cxx_qt_lib::QPolygonF; 14 | } 15 | 16 | extern "Rust" { 17 | fn clone_qpolygonf(p: &QPolygonF) -> QPolygonF; 18 | fn construct_qpolygonf() -> QPolygonF; 19 | } 20 | } 21 | 22 | fn construct_qpolygonf() -> QPolygonF { 23 | QPolygonF::default() 24 | } 25 | 26 | fn clone_qpolygonf(p: &QPolygonF) -> QPolygonF { 27 | p.clone() 28 | } 29 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qrect.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | use cxx_qt_lib::QRect; 8 | 9 | #[cxx::bridge] 10 | mod qrect_cxx { 11 | unsafe extern "C++" { 12 | include!("cxx-qt-lib/qrect.h"); 13 | 14 | type QRect = cxx_qt_lib::QRect; 15 | } 16 | 17 | extern "Rust" { 18 | fn construct_qrect() -> QRect; 19 | fn read_qrect(p: &QRect) -> bool; 20 | fn clone_qrect(p: &QRect) -> QRect; 21 | } 22 | } 23 | 24 | fn construct_qrect() -> QRect { 25 | QRect::new(1, 4, 2, 8) 26 | } 27 | 28 | fn read_qrect(r: &QRect) -> bool { 29 | r.x() == 1 && r.y() == 4 && r.width() == 2 && r.height() == 8 30 | } 31 | 32 | fn clone_qrect(r: &QRect) -> QRect { 33 | r.clone() 34 | } 35 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qregion.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Laurent Montel 3 | // 4 | // SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | use cxx_qt_lib::QRegion; 7 | 8 | #[cxx::bridge] 9 | mod qregion_cxx { 10 | unsafe extern "C++" { 11 | include!("cxx-qt-lib/qregion.h"); 12 | 13 | type QRegion = cxx_qt_lib::QRegion; 14 | } 15 | 16 | extern "Rust" { 17 | fn construct_qregion() -> QRegion; 18 | fn clone_qregion(p: &QRegion) -> QRegion; 19 | } 20 | } 21 | 22 | fn construct_qregion() -> QRegion { 23 | QRegion::default() 24 | } 25 | 26 | fn clone_qregion(p: &QRegion) -> QRegion { 27 | p.clone() 28 | } 29 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qsize.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | use cxx_qt_lib::QSize; 8 | 9 | #[cxx::bridge] 10 | mod qsize_cxx { 11 | unsafe extern "C++" { 12 | include!("cxx-qt-lib/qsize.h"); 13 | 14 | type QSize = cxx_qt_lib::QSize; 15 | } 16 | 17 | extern "Rust" { 18 | fn construct_qsize() -> QSize; 19 | fn read_qsize(p: &QSize) -> bool; 20 | fn clone_qsize(p: &QSize) -> QSize; 21 | } 22 | } 23 | 24 | fn construct_qsize() -> QSize { 25 | QSize::new(1, 4) 26 | } 27 | 28 | fn read_qsize(s: &QSize) -> bool { 29 | s.width() == 1 && s.height() == 4 30 | } 31 | 32 | fn clone_qsize(s: &QSize) -> QSize { 33 | s.clone() 34 | } 35 | -------------------------------------------------------------------------------- /tests/qt_types_standalone/rust/src/qtime.rs: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | // SPDX-FileContributor: Andrew Hayzen 3 | // SPDX-FileContributor: Gerhard de Clercq 4 | // 5 | // SPDX-License-Identifier: MIT OR Apache-2.0 6 | 7 | use cxx_qt_lib::QTime; 8 | 9 | #[cxx::bridge] 10 | mod qtime_cxx { 11 | unsafe extern "C++" { 12 | include!("cxx-qt-lib/qtime.h"); 13 | 14 | type QTime = cxx_qt_lib::QTime; 15 | } 16 | 17 | extern "Rust" { 18 | fn construct_qtime() -> QTime; 19 | fn read_qtime(p: &QTime) -> bool; 20 | fn clone_qtime(p: &QTime) -> QTime; 21 | } 22 | } 23 | 24 | fn construct_qtime() -> QTime { 25 | QTime::new(1, 2, 3, 4) 26 | } 27 | 28 | fn read_qtime(s: &QTime) -> bool { 29 | s.hour() == 1 && s.minute() == 2 && s.second() == 3 && s.msec() == 4 30 | } 31 | 32 | fn clone_qtime(s: &QTime) -> QTime { 33 | s.clone() 34 | } 35 | -------------------------------------------------------------------------------- /valgrind_suppressions.txt.license: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company 2 | # SPDX-FileContributor: Andrew Hayzen 3 | # SPDX-FileContributor: Gerhard de Clercq 4 | # 5 | # SPDX-License-Identifier: MIT OR Apache-2.0 --------------------------------------------------------------------------------