Qt Bridges - Python
QtBridges is a framework that simplifies the integration of Python with QtQuick/QML. It connects Python backends to QML frontends, improving development efficiency. The framework offers an easy, declarative method for linking Python classes, properties, signals, and slots to QML, with minimal Qt knowledge required from the Python developer.
Getting started
Why Qt Bridges?
As a Python developer, you can expose your Python classes to QML without learning the full PySide6 model/view system. QtBridges automatically handles property binding, signal connections, and model registration.
- Less boilerplate - No manual @Slot, @Property, or signal management required
- Automatic discovery - Public methods become callable from QML automatically
- Model integration - Python classes become QML-ready models with simple decorators
- Cross-language - Consistent API design across Python, Rust, C++, and more
Setting up development environment
Requirements:
- Python: Minimum version 3.9
Build requirements:
- CMake: Minimum version 3.18 -
- Qt: Minimum version 6.x (with `qtpaths` available in your PATH) -
- Build system: [scikit-build-core](https://github.com/scikit-build/scikit-build-core) is used for building and packaging the project -
- Documentation QDoc (Qt's built-in tool for generating API reference documentation) -
- Testing: pytest framework with pytest-qt plugin
Dependencies: QtBridges automatically installs the required runtime dependencies for Python:
- PySide6
- Shiboken6
You don’t need to manually install these; they are pulled in when you install QtBridges.
Installation
pip install QtBridgesBuilding From source
Build and Install the project
pip install . -Ccmake.define.QT_PATHS=/path/to/qtpaths
Building wheels:
pip wheel . -Ccmake.define.QT_PATHS=/path/to/qtpaths
Optional Build Flags Non-limited-api:
pip wheel . -Ccmake.define.QT_PATHS=/path/to/qtpaths \ -Cwheel.py-api=py3
Debug build:
pip wheel . -Ccmake.define.QT_PATHS=/path/to/qtpaths \ -Ccmake.define.CMAKE_INSTALL_DO_STRIP=0 \ -Ccmake.define.CMAKE_BUILD_TYPE=Debug
Install Development Dependencies Required for building documentation and running tests:
pip install -e ".[dev]"
Build Documentation with QDoc After installing development dependencies, run:
qdoc -project docs/QtBridges.qdoc qdoc -outputdir docs/html
Running Tests
pytest .Running
For running any project, go inside your directory and run the main file:
python main.pyTutorials
The example minimal_app
The `minimal_app` is a simple application that demonstrates the basics of QtBridges for Python. It shows how to expose a simple Python list model to QML and perform basic operations such as `insert`, `delete`, `move`, and `edit` items.
The application is located in `examples/minimal_app` folder and can be run after all the prerequisites are installed.
Running the example
python examples/minimal_app/main.py
How-to guides
TBD
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.