qtass-pyside6
Qt Advanced Stylesheets for PySide 6
This is the Python version of the Qt Advanced Stylesheets Project for C++.
The library allows runtime color switching for CSS stylesheet themes including SVG resources and SVG icons. The image below shows switching of accent color and switching between dark and light theme. Notice how the icons in the left sidebar change color when switching between dark and light theme.
The main features are:
- runtime switching of CSS colors
- runtime color switching of CSS SVG icons / resources
- runtime color switching of icons loaded via
loadThemeAwareSvgIcon() - runtime switching of QPalette colors
- definition of CSS styles that switch the complete application design
- definition of XML color themes that allow switching of theme colors (dark / light)
- switching of individual theme color or switching of accent color
- QML support
📦 Installation
Install from PyPI:
pip install qtass-pyside6
Accent color sources (1.0.0)
The existing accentColor variable now supports three sources. Theme selection
(Dark/Light) and accent selection are independent.
from PySide6.QtGui import QColor
from qtass import AccentSource, QtAdvancedStylesheet
style = QtAdvancedStylesheet() # construct before applying your own palette
style.set_current_style("metro")
style.set_current_theme("dark_orange")
style.set_accent_color(QColor("#4169e1")) # selects CUSTOM
style.set_accent_source(AccentSource.SYSTEM)
style.set_accent_source(AccentSource.THEME) # restore current XML theme's accent
THEME is the backwards-compatible default. CUSTOM survives subsequent theme
switches. SYSTEM reads Windows' native accent and tracks its changes without
reading back QtASS' own application palette. Unavailable system colors fall back
to the current theme; on other platforms the initial native Qt accent palette is
used as a snapshot. Construct the style before replacing the application's palette.
accent_color() returns the effective QColor. accent_color_changed(QColor) and
accent_source_changed(AccentSource) expose changes. Invalid custom colors are
rejected before changing the policy. Selecting CUSTOM without a saved custom color
raises ValueError. set_theme_variable_value("accentColor", value) also selects
persistent CUSTOM mode; call update_stylesheet() afterwards as before.
New accent setters and native change notifications refresh CSS, palette and SVG
resources and apply the generated stylesheet to QApplication. Existing explicit
update_stylesheet() callers continue applying style.stylesheet themselves.
Keep Qt calls on the GUI thread. Native Windows event callbacks are queued there
automatically. Native subscriptions are released on style destruction/application exit.
Applications own preference storage: persist the chosen source and custom color in per-user settings, not in shared theme XML files. QtASS does not change system personalization settings or automatically persist application preferences.
For tests or alternative platforms, subclass qtass.system_accent.AccentProvider,
implement color() -> QColor, and emit its changed(QColor) signal on the GUI
thread. Pass the instance as QtAdvancedStylesheet(accent_provider=provider).
The caller owns an injected provider; the default native provider is style-owned.
Run regression checks with:
python -m unittest discover -s tests -v
Metadata
Release files for qtass-pyside6 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qtass_pyside6-1.0.2.tar.gz | 1.6 MB | Without provenance | Details for qtass_pyside6-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qtass_pyside6-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for qtass_pyside6-1.0.2-py3-none-any.whl |
Total release size: 3.5 MB
Release files / qtass_pyside6-1.0.2.tar.gz
| Download URL | qtass_pyside6-1.0.2.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62d198ec805fae2f599a0f0612367495e10508321e4679e2406dc81ae3e7fc2f
|
|
BLAKE2b-256 checksum How to use checksums |
6ecee22b0907d43978ea73d2df31344da1e0844def61798513d109fce698518f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.2 CPython/3.14.10 Linux/7.0.0-1020-azure
|
Release files / qtass_pyside6-1.0.2-py3-none-any.whl
| Download URL | qtass_pyside6-1.0.2-py3-none-any.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d85ca9a22909e1a4daf4938e1aae4bed7a31beb43e28940e7411d823e469a66
|
|
BLAKE2b-256 checksum How to use checksums |
34d2d94d6951f41805590455cd0f94c97233a0efeb7d887c3265e7ff3ce5671f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.2 CPython/3.14.10 Linux/7.0.0-1020-azure
|
Security for qtass-pyside6 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.