Skip to content

Instantly share code, notes, and snippets.

@rcalixte
Created March 7, 2025 13:24
Show Gist options
  • Save rcalixte/339ede66703a988760829ecde2dc2c88 to your computer and use it in GitHub Desktop.
Save rcalixte/339ede66703a988760829ecde2dc2c88 to your computer and use it in GitHub Desktop.
Qt 6 for C & Zig

Qt 6 for C & Zig

Hi all,

As the title suggests, I've been working on Qt 6 bindings and wrappers for C and Zig. These can be thought of as a fork of the recently released Qt bindings for Go. Not to bury the lede, currently only 64-bit variants of Linux and FreeBSD are supported until interested folks on other 64-bit platforms are capable of testing and validation. In theory, any platform natively supported by both Qt and Zig's build system could be supported by these libraries. I'll try to keep this brief and fail but there is a lot to unpack here. This list can be considered an order of preference for how I'm asking folks to interact with the projects in the near-term:

  1. Consumption: Use the libraries! Head to the library repository for whichever target language you prefer and skip to the Building section. Install the dependencies, look over the build options, and then head to the examples repository. Clone the examples repository and kick off the build. While the build is running (and your computer heats up the room), head back to the library repository and read through the rest of the README. Q3 of the library FAQ is a good place to start but also many of the links to Qt documentation will be immensely valuable. If the build is still moving along, head to the README for the examples. Once the build is complete, run through a few of the examples. Many of them actually work! Once that tour is over, head to the source code in the cloned examples repository and make some small modifications like tweaking some of the strings. Head back to the root of the repository and re-run the same build as before. This is a sample of the developer experience these projects are aiming for. Now go off and make some awesome applications or port your existing ones! Share them at Discussions #1 of the respective language's library repository!

  2. Discussion: Unfortunately, for a slew of reasons, these projects are not quite ready for your code contributions. Therefore, I'm asking folks to start with the Discussions for the library repository (or the examples repository if needed) instead of Issues or Pull requests. If issues need to be created, they can be converted from the discussions, preferably once clearly defined scopes for potential pull requests exist. Folks interested in contributing code (who are more than welcome) should watch for the CONTRIBUTING.md file upload to know when the projects are ready. The reality is that these projects are being released both earlier than I would have liked and later than I had planned. The reason these are being released with much in-flight work to come is because I think there is value in the modified backend code which generates the C ABI bindings, but for targeting more C-like languages. Not only do I think other languages that utilize C FFI can make use of the bindings, I think a small community of maintainers across different target languages can help the shared common backend mature even quicker, resulting in the most phenomenal Qt bindings for all. There's already proof of this with the work being done on bindings for Nim. Plus the author of the bindings for Go is just as great. If it's C3, D, or whatever esoteric language, come join us!

  3. Security: I hope this isn't needed but we can never be too careful. If you see something that isn't right, please practice proper disclosure and report a vulnerability using the Security tab of the repository of the vulnerable project(s). A more formal SECURITY.md will be available in the future. Thanks in advance!

Aaaand... I almost forgot the links:

"Cute" is how it's pronounced. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment