Python bindings for Qlementine, a modern QStyle for desktop Qt6 applications
Project description
PyQt6/PySide6-Qlementine
PyQt6/PySide6 Bindings for (the amazing) Qlementine
Modern QStyle for desktop Qt6 applications... ready for Python!
Installation
pip install PyQt6-Qlementine
# or
pip install PySide6-Qlementine
Usage
# or PySide6 & PySide6Qlementine
from PyQt6.QtWidgets import QApplication
from PyQt6.QtCore import QJsonDocument
from PyQt6Qlementine import QlementineStyle, Theme
app = QApplication([])
# Apply Qlementine as the application style
# (this alone will apply the default Qlementine theme, which is lovely)
style = QlementineStyle(app)
app.setStyle(style)
# Define a custom theme, for all keys, see:
# https://oclero.github.io/qlementine/theme/#full-example
theme_dict = {
"meta": {"name": "Custom", "author": "Your Name", "version": "1.0"},
"primaryColor": "#ff00ff",
"backgroundColorMain1": "#1a1a2e",
"backgroundColorMain2": "#1a1a2e",
}
theme = Theme.fromJsonDoc(QJsonDocument.fromVariant(theme_dict))
style.setTheme(theme)
See C++ documentation for more information.
See also examples in this repo.
The autogenerated type stubs are also useful for understanding the API.
Why QStyle over QSS?
If you're coming from the Python Qt ecosystem, you're likely used to theming via Qt Style Sheets (QSS) — every major Python theming library (QDarkStyleSheet, qt-material, BreezeStyleSheets, etc.) relies on them.
QSS is easy to author, but it comes with serious trade-offs: it breaks
setPalette() and
setFont(), ignores system
dark/light mode changes, forces you to restyle all sub-controls when you
customize one, and adds measurable startup and reparenting cost from CSS
parsing.
A proper parametrized QStyle implementation (like Qlementine) avoids all of
this — colors, spacing, animations, border-radii, and pixel metrics are computed
natively in C++ with full QPainter access, zero parsing overhead, and complete
respect for QPalette. The reason Python libraries haven't taken this approach
is that subclassing QProxyStyle in Python incurs a C++/Python boundary
crossing on every paint call, making it unperformant for anything beyond icon
overrides.
Qlementine sidesteps that entirely: the style is implemented in C++ and simply
exposed to Python (through these bindings), giving you the correctness and
performance of a native QStyle implementation with the ease of use of a Python
library (and parametrized geometry, colors, animations, and fonts through
Qlementine's Theme API).
License
The code in this repository is licensed under the MIT License.
The packaged/distributed bindings are:
- GPL-3.0-only for PyQt6-Qlementine (required by PyQt6's license)
- MIT for PySide6-Qlementine
See the LICENSE file in each package for more details.
Developers & Contributing
Contributions are welcome! See CONTRIBUTING.md for dev tips.
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 Distributions
Built Distributions
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 pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb656d510f236fb4817a5a521c0415e5bc451fde92d569d7f05434bc4d1e3a52
|
|
| MD5 |
cf7d248fb6302d965654e363ae2d3bc0
|
|
| BLAKE2b-256 |
e6d8cb28e79e7a9141a47298f8c21f3254094b66cdd0678e0d6727ae1a679366
|
Provenance
The following attestation bundles were made for pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-win_amd64.whl:
Publisher:
publish-pyqt6.yml on pyapp-kit/PyQlementine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-win_amd64.whl -
Subject digest:
fb656d510f236fb4817a5a521c0415e5bc451fde92d569d7f05434bc4d1e3a52 - Sigstore transparency entry: 1280243262
- Sigstore integration time:
-
Permalink:
pyapp-kit/PyQlementine@b3de39795669c4108f396b960d4308b43dae37eb -
Branch / Tag:
refs/tags/pyqt6/v1.4.3.0rc7 - Owner: https://github.com/pyapp-kit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pyqt6.yml@b3de39795669c4108f396b960d4308b43dae37eb -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70d599f156d1ba0e74fba024421b95e41f8cb9bb3cd24eac10eaa28df991ecc1
|
|
| MD5 |
f04ad72c6113d9ee2944c843813eb8d3
|
|
| BLAKE2b-256 |
f905cf9ef482b51d7e3b9c586e83912591e7a2c7fe3d6b446caec27ccee7f75c
|
Provenance
The following attestation bundles were made for pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-manylinux_2_28_x86_64.whl:
Publisher:
publish-pyqt6.yml on pyapp-kit/PyQlementine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
70d599f156d1ba0e74fba024421b95e41f8cb9bb3cd24eac10eaa28df991ecc1 - Sigstore transparency entry: 1280243259
- Sigstore integration time:
-
Permalink:
pyapp-kit/PyQlementine@b3de39795669c4108f396b960d4308b43dae37eb -
Branch / Tag:
refs/tags/pyqt6/v1.4.3.0rc7 - Owner: https://github.com/pyapp-kit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pyqt6.yml@b3de39795669c4108f396b960d4308b43dae37eb -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9580ebc9c5033d79340c453376354068f7549e1f58333ce6a1dc9a6e49ca1c36
|
|
| MD5 |
f43a8e4f6f0efc19bed5c6701384bb3f
|
|
| BLAKE2b-256 |
e8ba6ef57e08b9e548f6ee5979cb7bfc86ddde512ba28c48328197905a2ed80d
|
Provenance
The following attestation bundles were made for pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
publish-pyqt6.yml on pyapp-kit/PyQlementine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyqt6_qlementine-1.4.3.0rc7-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
9580ebc9c5033d79340c453376354068f7549e1f58333ce6a1dc9a6e49ca1c36 - Sigstore transparency entry: 1280243264
- Sigstore integration time:
-
Permalink:
pyapp-kit/PyQlementine@b3de39795669c4108f396b960d4308b43dae37eb -
Branch / Tag:
refs/tags/pyqt6/v1.4.3.0rc7 - Owner: https://github.com/pyapp-kit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pyqt6.yml@b3de39795669c4108f396b960d4308b43dae37eb -
Trigger Event:
push
-
Statement type: