{"id":13667972,"url":"https://github.com/KDAB/cxx-qt","last_synced_at":"2025-04-26T18:30:54.944Z","repository":{"id":38094283,"uuid":"433904791","full_name":"KDAB/cxx-qt","owner":"KDAB","description":"Safe interop between Rust and Qt","archived":false,"fork":false,"pushed_at":"2025-04-25T12:04:39.000Z","size":9027,"stargazers_count":1200,"open_issues_count":115,"forks_count":82,"subscribers_count":34,"default_branch":"main","last_synced_at":"2025-04-25T13:23:33.682Z","etag":null,"topics":["qt","qt5","qt6","rust"],"latest_commit_sha":null,"homepage":"https://kdab.github.io/cxx-qt/book/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KDAB.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSES/Apache-2.0.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-12-01T16:35:29.000Z","updated_at":"2025-04-25T12:04:43.000Z","dependencies_parsed_at":"2024-01-24T11:41:54.762Z","dependency_job_id":"5c10248f-cd0c-48bc-a6f9-e0a9fb6ee088","html_url":"https://github.com/KDAB/cxx-qt","commit_stats":{"total_commits":1353,"total_committers":33,"mean_commits":41.0,"dds":0.4212860310421286,"last_synced_commit":"8ac1f79dc99e199328d71e2866b7cd833f04732f"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDAB%2Fcxx-qt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDAB%2Fcxx-qt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDAB%2Fcxx-qt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KDAB%2Fcxx-qt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KDAB","download_url":"https://codeload.github.com/KDAB/cxx-qt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250824445,"owners_count":21493278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["qt","qt5","qt6","rust"],"created_at":"2024-08-02T07:00:57.533Z","updated_at":"2025-04-26T18:30:49.929Z","avatar_url":"https://github.com/KDAB.png","language":"Rust","funding_links":[],"categories":["Rust","GUI","Programming"],"sub_categories":["Rust 🦀"],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2021-2022 Klarälvdalens Datakonsult AB, a KDAB Group company \u003cinfo@kdab.com\u003e\nSPDX-FileContributor: Andrew Hayzen \u003candrew.hayzen@kdab.com\u003e\nSPDX-FileContributor: Gerhard de Clercq \u003cgerhard.declercq@kdab.com\u003e\nSPDX-FileContributor: Leon Matthes \u003cleon.matthes@kdab.com\u003e\n\nSPDX-License-Identifier: MIT OR Apache-2.0\n--\u003e\n\n# CXX-Qt\n\n[![Github](https://img.shields.io/badge/github-kdab%2Fcxx--qt-informational?logo=github)](https://github.com/kdab/cxx-qt)\n[![Book status](https://img.shields.io/github/actions/workflow/status/kdab/cxx-qt/book.yml?label=book\u0026logo=mdbook)](https://kdab.github.io/cxx-qt/book)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/kdab/cxx-qt/github-cxx-qt-tests.yml)\n![License (MIT/Apache2.0)](https://img.shields.io/crates/l/cxx-qt)\n[![REUSE status](https://api.reuse.software/badge/github.com/KDAB/cxx-qt)](https://api.reuse.software/info/github.com/KDAB/cxx-qt)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n\n| Crate | Status |\n| --- | --- |\n| cxx-qt | [![docs.rs](https://img.shields.io/docsrs/cxx-qt?logo=docsdotrs)](https://docs.rs/cxx-qt) [![Crates.io](https://img.shields.io/crates/v/cxx-qt)](https://crates.io/crates/cxx-qt) |\n| cxx-qt-build | [![docs.rs](https://img.shields.io/docsrs/cxx-qt-build?logo=docsdotrs)](https://docs.rs/cxx-qt-build) [![Crates.io](https://img.shields.io/crates/v/cxx-qt-build)](https://crates.io/crates/cxx-qt-build) |\n| cxx-qt-lib | [![docs.rs](https://img.shields.io/docsrs/cxx-qt-lib?logo=docsdotrs)](https://docs.rs/cxx-qt-lib) [![Crates.io](https://img.shields.io/crates/v/cxx-qt-lib)](https://crates.io/crates/cxx-qt-lib) |\n| qt-build-utils | [![docs.rs](https://img.shields.io/docsrs/qt-build-utils?logo=docsdotrs)](https://docs.rs/qt-build-utils) [![Crates.io](https://img.shields.io/crates/v/qt-build-utils)](https://crates.io/crates/qt-build-utils) |\n\nIf you want to get in touch with us, feel free to join our Zulip Chat at:\n[https://cxx-qt.zulipchat.com](https://cxx-qt.zulipchat.com).\nThere we openly discuss all things about CXX-Qt development.\n\nCXX-Qt is a set of Rust crates for creating bidirectional Rust ⇄ C++ bindings with [Qt](https://www.qt.io/).\nIt can be used to integrate Rust into C++ applications using CMake or used to build Rust applications with Cargo.\nCXX-Qt provides tools for implementing [QObject](https://doc.qt.io/qt-6/object.html) subclasses in Rust which can\nbe used from C++, QML, and JavaScript. It consists of two parts:\n\n* cxx-qt-lib, a library of Rust bindings to common QtCore and QtGui classes made with [CXX](https://cxx.rs/)\n\n* cxx-qt \u0026 cxx-qt-build, a pair of Rust \u0026 C++ code generators which are a superset of CXX plus additional attributes\nto interface with Qt's [signals \u0026 slots](https://doc.qt.io/qt-6/signalsandslots.html) and [property system](https://doc.qt.io/qt-6/properties.html).\nThe cxx-qt crate implements a macro for Rust code generation. cxx-qt-build is used in [Cargo build scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html)\nto generate and compile the corresponding C++ code.\n\nThe [CXX-Qt Book](https://kdab.github.io/cxx-qt/book/getting-started/index.html) walks through a minimal example\nstep-by-step and documents CXX-Qt's features for the latest release. The [examples folder](./examples) contains\ndemonstrations of using threading, QQmlExtensionPlugin, and various other features.\n\nCXX-Qt is tested on CI on Linux, Windows, and macOS (all on x86_64). It should work on other platforms that Qt and\nRust both support, however, these are not tested regularly.\n\nCXX-Qt is in early development and the API changes frequently. For the latest documentation between releases, [install mdBook](https://rust-lang.github.io/mdBook/guide/installation.html)\nand run `mdbook serve --open` in the [book folder](./book). It will open your own browser.\nIf you need to open it in another browser goto url [http://localhost:3000](http://localhost:3000).\n\n## Supported Qt Versions\n\nWe currently aim to support the Qt versions that have official support by the Qt company.\n\nAt the moment this means:\n\n* Qt 5.15 LTS\n* All versions of Qt 6\n\nVersions below Qt 5.15 LTS are *explicitly unsupported*.\n\n## Comparison to other Rust Qt bindings\n\n| Project | Integrate into C++ codebase  | Safe Rust | QML | QWidgets | Maintained\u003csup\u003e1\u003c/sup\u003e | Binding mechanism |\n|-------- | ---------------------------- | --------- | --- | -------- | ---------------------- | ----------------- |\n| CXX-Qt  |  ✔                           | ✔         | ✔ | limited\u003csup\u003e2\u003c/sup\u003e | ✔       | [cxx](https://cxx.rs) plus additional code generation to implement QObject subclasses in Rust and bind them to C++ |\n| [qmetaobject](https://github.com/woboq/qmetaobject-rs/) | ✗ | ✔ | ✔ | ✗ | ✔ | [cpp](https://github.com/mystor/rust-cpp) macro to write C++ inline in Rust, plus Rust macros to create QObject subclasses from Rust structs |\n| [Rust Qt Binding Generator](https://invent.kde.org/sdk/rust-qt-binding-generator) | ✔ | ✔ | ✔ | limited\u003csup\u003e2\u003c/sup\u003e | ✗ | generates Rust traits and C++ bindings from JSON description of QObject subclass |\n| [rust-qt](https://rust-qt.github.io/) | ✗ | ✗ | ✔ | ✔ | ✗ | [ritual](https://rust-qt.github.io/ritual/) to generate unsafe Rust bindings from C++ headers |\n| [qml-rust](https://github.com/White-Oak/qml-rust) | ✗ | ✔ | ✔ | ✗ | ✗ | [DOtherSide](https://github.com/filcuc/DOtherSide) C wrapper for QML C++ classes |\n| [qmlrs](https://github.com/flanfly/qmlrs) | ✗ | ✔ | ✔ | ✗ | ✗ | own C++ library to bind QQmlApplicationEngine |\n| [qmlrsng](https://github.com/nbigaouette/qmlrsng) | ✗ | ✔ | ✔ | ✗ | ✗ | [libqmlbind](https://github.com/seanchas116/libqmlbind) with [bindgen](https://rust-lang.github.io/rust-bindgen/) |\n| [rust-qml](https://github.com/florianjacob/rust-qml) | ✗ | ✔ | ✔ | ✗ | ✗ | [libqmlbind](https://github.com/seanchas116/libqmlbind) |\n\n\u003csup\u003e1\u003c/sup\u003e: maintained: supports Qt6 and repository has had nontrivial commits within last year as of August 2022\n\n\u003csup\u003e2\u003c/sup\u003e: CXX-Qt and Rust Qt Binding Generator can be used to implement custom QObjects subclasses in Rust. C++\nbindings for these QObject subclasses can be used in QWidgets applications, but these projects do not provide Rust\nbindings for QWidgets APIs.\n\n## Contributing to CXX-Qt\n\n### Clone the Git repository\n\nThis repository contains symbolic links, which requires some setup on Windows 10 before cloning the repository.\nFirst, [enable Windows Developer Mode](https://learn.microsoft.com/en-us/gaming/game-bar/guide/developer-mode)\nto avoid needing administrator privileges to create symlinks. Then, enable symlinks in Git:\n\n```shell\ngit config --global core.symlinks true\n```\n\nNow clone the Git repository:\n\n```shell\ngit clone https://github.com/KDAB/cxx-qt.git\n```\n\n### Building\n\nEnsure that you have the following installed\n\n* C++ compiler\n* [clang-format](https://clang.llvm.org/docs/ClangFormat.html)\n* [CMake](https://cmake.org/)\n* [Qt 5 and/or Qt 6](https://www.qt.io/)\n* [Rust toolchain](https://www.rust-lang.org/)\n* [mold](https://github.com/rui314/mold), [lld](https://lld.llvm.org/), or GNU ld.gold for Linux (lld is included in the XCode toolchain on macOS)\n\nThis repository's build system uses CMake, which calls Cargo under the hood to build all the\nexamples and tests. One example can be built and run with Cargo directly without using CMake:\n`cargo run -p qml-minimal-no-cmake` (this example is also built in the CMake build). This\nexample does not link with GNU ld.bfd which is the default linker on most Linux distributions;\ninstalling [mold](https://github.com/rui314/mold), [lld](https://lld.llvm.org/), or GNU ld.gold\n(from GNU binutils but may be separate package) is required on Linux.\n\nCXX-Qt defaults to building with Qt6. If you want to build with Qt5 when both are installed, add `-D USE_QT5=ON` to the CMake configure step.\n\n```bash\ncmake -S . -B build\ncmake --build build\n```\n\n### Run the basic QML example\n\n```bash\n./build/examples/qml_minimal/example_qml_minimal\n```\n\n### Testing\n\nTesting assumes that `cargo clippy` and `cargo fmt` are available, you may need to install these with `rustup component add clippy rustfmt`.\n\nFor testing the book, it assumes that [`mdbook`](https://rust-lang.github.io/mdBook/guide/installation.html) and [`mdbook-linkcheck`](https://github.com/Michael-F-Bryan/mdbook-linkcheck) are installed.\n\nFor license and memory testing, it assumes that you have [`reuse`](https://reuse.software/) installed (eg via `pip3 install reuse`) and [`valgrind`](https://valgrind.org/).\n\n```bash\nctest --test-dir build\n```\n\n## Licensing\n\nCXX-Qt is Copyright (C) Klarälvdalens Datakonsult AB, and is available under\nthe terms of the [MIT](https://github.com/KDAB/cxx-qt/blob/main/LICENSES/MIT.txt)\nor the [Apache-2.0](https://github.com/KDAB/cxx-qt/blob/main/LICENSES/Apache-2.0.txt)\nlicenses.\n\nContact KDAB at \u003cinfo@kdab.com\u003e to inquire about additional features or\nservices related to this project.\n\nThe following CMake source files are available under the BSD-3-Clause\n\n* [cmake/CompilerCaching.cmake](./cmake/CompilerCaching.cmake) - a helper for using sccache\n\n# About KDAB\n\nCXX-Qt is supported and maintained by Klarälvdalens Datakonsult AB (KDAB).\n\nThe KDAB Group is the global No.1 software consultancy for Qt, C++ and\nOpenGL applications across desktop, embedded and mobile platforms.\n\nThe KDAB Group provides consulting and mentoring for developing Qt applications\nfrom scratch and in porting from all popular and legacy frameworks to Qt.\nWe continue to help develop parts of Qt and are one of the major contributors\nto the Qt Project. We can give advanced or standard trainings anywhere\naround the globe on Qt as well as C++, OpenGL, 3D and more.\n\nPlease visit \u003chttps://www.kdab.com\u003e to meet the people who write code like this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKDAB%2Fcxx-qt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKDAB%2Fcxx-qt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKDAB%2Fcxx-qt/lists"}