Skip to main content

Qt Theme

Qt theme in pure qss - 纯 qss 的 Qt 主题

Preview and Export Resource Package Online - 在线预览和导出资源包

dark

light

Usage

Install by pip install QtTheme then:

# import resource
import QtTheme.PySide6 as QtTheme
# import QtTheme.PySide2 as QtTheme
# import QtTheme.PyQt6 as QtTheme
# import QtTheme.PyQt5 as QtTheme

# set style sheet of the root widget
mainwindow.setStyleSheet(QtTheme.getThemeStyle('Flat', 'Dark', 'Blue', 'Pink'))

# set color of widgets
button.setProperty("Color", "Primary")

Alternatively, without installing QtTheme, you can export a single-style qrc resource package through the online website. Use RCC to add it to your project.

pyside6-rcc -o resource.py QtTheme.qrc
# import resource
import resource

# open qss file
qss = QFile(":/QtTheme/theme/Flat/Dark/Blue/Pink.qss")
qss.open(QFile.OpenModeFlag.ReadOnly)

# set style sheet of the root widget
mainwindow.setStyleSheet(qss.readAll().data().decode())

# set color of widgets
button.setProperty("Color", "Primary")

API

Use QWidget.setProperty to set color of widget:

QWidget.setProperty("Color", "XXX")
Color Explain
Primary The primary color selected when exporting
Secondary The secondary color selected when exporting
Success The success color(GREEN)
Warning The warning color(ORANGE)
Danger The error color(RED)

To get themes:

def getThemes(): ...

def getBaseColors(theme:str): ...

def getPrimaryColors(theme:str, base:str): ...

def getSecondaryColors(theme:str, base:str, primary:str): ...

def getThemeStyle(theme:str, base:str, primary:str, secondary:str): ...

Tips

Metadata

Release files for QtTheme 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for QtTheme 1.0.2
File Size Uploaded
qttheme-1.0.2.tar.gz 34.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for QtTheme 1.0.2
File Interpreter ABI Platform
qttheme-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 71.1 MB

Release files / qttheme-1.0.2.tar.gz

Download URL qttheme-1.0.2.tar.gz
Size 34.8 MB
Tags Source
SHA-256 checksum
How to use checksums
2415ff62fe9314e373f69275163e147c32b89824a900a9e839e0efe3e6c24ffb
BLAKE2b-256 checksum
How to use checksums
64268e71888bdb707a9556a53c72a3a1b795c662fec106c6e51506a8f23e8b6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / qttheme-1.0.2-py3-none-any.whl

Download URL qttheme-1.0.2-py3-none-any.whl
Size 36.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
918bdada36647b062e987183d240b3ad25daa945f91cd6b6e66098053e0625be
BLAKE2b-256 checksum
How to use checksums
2a3c118d3312565a91dc78d7be862bc2a80df70cd8c9f556451a2faa0eee26fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page