Build Qt applications in a reactive, declarative, and composable way
Project description
qtcompose
Build Qt applications in a reactive, declarative, and composable way.
qtcompose lets you describe your UI as a tree of components whose properties are driven by reactive values. Update state and the UI updates automatically.
[!WARNING] This project is under active development. APIs and behavior may change quickly, and documentation is still in progress. Feedback and early experimentation are welcome.
Installation
pip install qtcompose
You’ll also need a Qt binding. The examples use PySide6.
pip install PySide6
Quick example
A small counter app where the label updates automatically when count changes:
from PySide6 import QtWidgets
from qtcompose.rx import Subject, fn
from qtcompose.ui import (
QBoxLayoutItem,
QLabel,
QMainWindow,
QPushButton,
QVBoxLayout,
QWidget,
)
app = QtWidgets.QApplication()
count = Subject(0)
window = QMainWindow(
children=Subject(
QWidget(
layout=Subject(
QVBoxLayout(
children=Subject(
[
QBoxLayoutItem.Child(
QLabel(
text=fn.pipe(
count,
fn.map_(lambda cnt: f"Count: {cnt}")
)
)
),
QBoxLayoutItem.Child(
QPushButton(
text=Subject("Click Me!"),
on_click=Subject(
lambda _: count.push(
lambda prev: prev + 1
)
),
)
),
]
)
)
)
)
)
)()
window.show()
app.exec()
Further reading
For a deeper explanation of the ideas behind this project, check out my blog post:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qtcompose-0.2.0.tar.gz.
File metadata
- Download URL: qtcompose-0.2.0.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24320438c1e948d46902e9b7f9eadbfe78f4f3177fa497b3c8601c7ffc7780d7
|
|
| MD5 |
e63c00ddaae6ec397feae47ce0341c83
|
|
| BLAKE2b-256 |
440127d24155958cc6f334988df16057caf6394229824ed7190da1559acf4d30
|
Provenance
The following attestation bundles were made for qtcompose-0.2.0.tar.gz:
Publisher:
publish.yaml on Lucino772/qtcompose
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qtcompose-0.2.0.tar.gz -
Subject digest:
24320438c1e948d46902e9b7f9eadbfe78f4f3177fa497b3c8601c7ffc7780d7 - Sigstore transparency entry: 789459663
- Sigstore integration time:
-
Permalink:
Lucino772/qtcompose@0286ebdb204308cf4340486d1e85416cfd4a55ff -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Lucino772
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@0286ebdb204308cf4340486d1e85416cfd4a55ff -
Trigger Event:
push
-
Statement type:
File details
Details for the file qtcompose-0.2.0-py3-none-any.whl.
File metadata
- Download URL: qtcompose-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
219beb259445009ea2e4f13d24c546c0fe9e09776a05a6ebe382e79f7379d1a4
|
|
| MD5 |
f575051786055a1a0711e3e38b377f2e
|
|
| BLAKE2b-256 |
0e55bedaee097a117b30c49e2f7bdff1ef115c1d8b938d34f4c7e7fc8048c4d1
|
Provenance
The following attestation bundles were made for qtcompose-0.2.0-py3-none-any.whl:
Publisher:
publish.yaml on Lucino772/qtcompose
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qtcompose-0.2.0-py3-none-any.whl -
Subject digest:
219beb259445009ea2e4f13d24c546c0fe9e09776a05a6ebe382e79f7379d1a4 - Sigstore transparency entry: 789459667
- Sigstore integration time:
-
Permalink:
Lucino772/qtcompose@0286ebdb204308cf4340486d1e85416cfd4a55ff -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Lucino772
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@0286ebdb204308cf4340486d1e85416cfd4a55ff -
Trigger Event:
push
-
Statement type: