Skip to content

qt/qtbridge-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qt Bridge - Python - Pre Release

Copyright (C) 2026 The Qt Company Ltd. SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only

About

Qt Bridges 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. Additionally, it also enables the Python user to completely control QtQuick/QML components from Python, without needing to write any QML code.

Why a Python Qt Bridge?

As a Python developer, you can expose your Python classes to QML without learning the full Qt for Python (PySide6) model/view system. Qt Bridges 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: Reuse the same QML files across multiple languages supported by Qt Bridges.

Prerequisites

This projects needs Python 3.9+ installed in your system, including pip. The dependencies are fetched at build time, and are included in the pyproject.toml file.

When building you will need:

  • One of the supported platforms:
    • Windows 11 (x64)
    • Linux (x86_64, aarch64)
    • macOS (arm64)
  • CMake: Minimum version 3.18
  • Qt: Minimum version 6.10
  • PySide6 and Shiboken6: Install version 6.10 before building with pip install PySide6==6.10
  • Build system: 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

Build & Install

When building from source, you can use pip in order to create the wheels or install directly.

To create the wheels:

pip wheel . -Ccmake.define.QT_PATHS=/path/to/qtpaths

To build and install directly:

pip install . -Ccmake.define.QT_PATHS=/path/to/qtpaths

Future versions of this bridge will be available on PyPI, and you will be able to install it using:

pip install qtbridge

For developers

pip install -e ".[dev]"

Running tests

pytest .

Building the documentation

cd docs
pip install -r requirements.txt
make html

Open docs/_build/html/index.html in a browser to view the result.

Examples

Explore the following examples to get started with QtBridge for Python. Each example demonstrates different features and capabilities. Check out the README.md in each example folder for detailed information:

  • simple_app - A simple application to get you started with QtBridge
  • minimal_app - Expands on simple_app application demonstrating CRUD operations on a list
  • counter - Simple counter example with basic state management
  • quiz_example - Interactive quiz application
  • colorpaletteclient - Advanced example with REST API integration and color palette management

Stay in touch

You can reach us in the Qt Forum, specifically in the Qt Bridges category.

Terms and Conditions

If you, your employer, or the legal entity you act on behalf of hold commercial license(s) with a Qt Group entity, Qt Bridges constitutes Pre-Release Code under the Qt License/Frame Agreement governing those licenses, and that agreement's terms and conditions relating to Pre-Release Code apply to your use of Qt Bridges as found in this repo. This Qt Bridges repo may provide links or access to third-party libraries or code (collectively "Third-Party Software") to implement various functions. Use or distribution of Third-Party Software is discretionary and in all respects subject to applicable license terms of applicable third-party right holders.

Additional Terms and Conditions

The Qt Bridge for Python is built using PySide6, which is licensed under LGPLv3 or Commercial licenses, see https://www.qt.io/development/qt-framework/qt-licensing

PySide6 provides optional support for NumPy. Applications built with QtBridge for Python and using NumPy will include NumPy licensed under the modified BSD license

About

Qt Bridge for Python. Qt Bridges enables developers to provide application logic written in a foreign language to Qt Quick applications by offering a simple API that follows the target language’s style and principles. This repository contains the implementation for Python.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors