
[](https://github.com/rcalixte/libqt6zig/blob/master/LICENSE)
[-fdc009?logo=zig&logoColor=f7a41d&label=Zig)](https://ziglang.org/download/)
[](https://github.com/rcalixte/libqt6zig/actions/workflows/docs.yml)
---
MIT-licensed Qt 6 bindings for Zig
This library is a straightforward binding of the Qt 6.8+ API. You must have a working C, C++, and Zig development toolchain to use this binding as well as the development files needed to build Qt 6 applications. This library and the related examples use the Zig toolchain. The [Building](#building) section below has instructions for installing the required dependencies.
For previous libqt6zig versions supporting Qt 6.4+, there are branches corresponding to the major and minor version of the Qt base, e.g. `6.4`. Note that these versions will receive minimal support and should be considered frozen.
This library is designed to be used as a dependency in a larger application and not as a standalone library. The versioning scheme used by this library is based on the Qt version used as a base to generate the bindings with an additional nod to the library revision number. Any breaking changes to the library will be reflected in the changelog.
These bindings are based on the [MIQT bindings for Go](https://github.com/mappu/miqt) that were released in August 2024. This library features support for Qt Core, GUI, Widgets, and Network as well as [additional Qt modules](https://doc.qt.io/qt-6/qt-additional-modules.html) such as Multimedia, Print Support, Spatial Audio, SQL, SVG, WebChannel, WebEngine, and more. In addition to Qt modules, this library also features support for third-party libraries such as [QCustomPlot](https://www.qcustomplot.com), [QScintilla](https://riverbankcomputing.com/software/qscintilla), various [KDE Frameworks](https://develop.kde.org/products/frameworks/), and others. This library has support for slots/signals, subclassing, custom widgets, async via Qt, etc. In addition, there is library tooling that provides native support for Qt Creator/Designer forms and [the Qt Resource System](https://doc.qt.io/qt-6/resources.html). With improper handling, it is possible to encounter segmentation faults or errors but developing in the Debug build mode affords significant advantages that aid the developer experience. Q3 of the [FAQ](#faq) is a decent entry point for newcomers in addition to the [examples](https://github.com/rcalixte/libqt6zig-examples) and the [demo application](https://github.com/rcalixte/libqt6zig-demo). Please try out the library and start a [discussion](https://github.com/rcalixte/libqt6zig/discussions) if you have any questions or issues directly relevant to this library.
---
### TABLE OF CONTENTS
- [Supported platforms](#supported-platforms)
- [License](#license)
- [Examples](#examples)
- [Building](#building)
- [FreeBSD (native)](#freebsd-native)
- [Linux (native)](#linux-native)
- [Debian-based distributions](#debian-based-distributions)
- [Fedora-based distributions](#fedora-based-distributions)
- [Arch-based distributions](#arch-based-distributions)
- [openSUSE-based distributions](#opensuse-based-distributions)
- [macOS (native)](#macos-native)
- [Windows (native)](#windows-native)
- [Tools](#tools)
- [FreeBSD](#freebsd)
- [Linux](#linux)
- [Debian-based](#debian-based)
- [Fedora-based](#fedora-based)
- [Arch-based](#arch-based)
- [openSUSE-based](#opensuse-based)
- [macOS](#macos)
- [Windows](#windows)
- [Usage](#usage)
- [FAQ](#faq)
- [Q1. Can I release a proprietary, commercial app with this binding?](#q1-can-i-release-a-proprietary-commercial-app-with-this-binding)
- [Q2. How long does it take to compile?](#q2-how-long-does-it-take-to-compile)
- [Q3. How does the `libqt6zig` API differ from the official Qt C++ API?](#q3-how-does-the-libqt6zig-api-differ-from-the-official-qt-c-api)
- [API at a glance](#api-at-a-glance)
- [Objects](#objects)
- [Signals/slots](#signalsslots)
- [Enums](#enums)
- [Q4. What build modes are supported by the library?](#q4-what-build-modes-are-supported-by-the-library)
- [Q5. How can I add bindings for another Qt library?](#q5-how-can-i-add-bindings-for-another-qt-library)
- [Special Thanks](#special-thanks)
Supported platforms
-------------------
| OS | Arch | Linkage (Bindings) | Status |
| ------- | ------ | ------------------ | ------- |
| FreeBSD | arm64 | Static | ✅ Works |
| FreeBSD | x86_64 | Static | ✅ Works |
| Linux | arm64 | Static | ✅ Works |
| Linux | x86_64 | Static | ✅ Works |
| macOS | arm64 | Static | ✅ Works |
| Windows | x86_64 | Static | ✅ Works |
By default, these bindings are statically linked and the auxiliary dependent libraries are dynamically linked.
Some libraries have restrictions, either due to limited platform support, less-permissive licensing, or other reasons. For less-permissive licenses, these restrictions are documented in the library's README file. The prefix paths for the subdirectory for these libraries are documented below.
| Prefix | Operating System Support | Licensing |
| ------------------ | ------------------------- | ----------- |
| extras- | all platforms