Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

PyQtDarkTheme

> 开发工具
Open source

A flat dark theme for PySide and PyQt.

750 stars0 likes0 views
WebsiteGitHub

About

A flat dark theme for PySide and PyQt.

PyQtDarkTheme

PyQtDarkTheme applies a flat dark theme to QtWidgets application. There's a light theme too. Color balanced from the dark theme for easy viewing in daylight.

Check out the complete documentation.

Project status Tests

Features

  • A flat dark and light theme
  • Support PySide and PyQt
  • Sync with OS's theme and accent (Mac, Windows, Linux)
  • Resolve the style differences between Qt versions
  • Provide dark/light theme QPalette
  • Override Qt old standard icons

Themes

Dark Theme

Light Theme

Requirements

  • Python 3.7+
  • Qt 5.15+
  • PySide6, PyQt6, PyQt5 or PySide2

Installation Method

  • Last released version

    pip install pyqtdarktheme
  • Latest development version

    pip install git+https://github.com/5yutan5/PyQtDarkTheme.git@main

Usage

python
import sys

from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton

import qdarktheme

app = QApplication(sys.argv)
# Apply the complete dark theme to your Qt App.
qdarktheme.setup_theme()

main_win = QMainWindow()
push_button = QPushButton("PyQtDarkTheme!!")
main_win.setCentralWidget(push_button)

main_win.show()

app.exec()

Further information can be found in our docs:

  • Usage Guide

Enable HiDPI

python
# enable_hi_dpi() must be called before the instantiation of QApplication.
qdarktheme.enable_hi_dpi()
app = QApplication(sys.argv)
qdarktheme.setup_theme()

For Qt6 bindings, HiDPI “just works” without using this function.

Light theme

python
qdarktheme.setup_theme("light")

Sync with OS's theme and accent

python
qdarktheme.setup_theme("auto")

On macOS, qdarktheme also syncs with accent colors.

Customizing colors

You can customize the theme color.

python
# Customize accent color.
qdarktheme.setup_theme(custom_colors={"primary": "#D0BCFF"})

For a list of all customizable colors, see the Theme Color Reference:

  • Theme Color

Sharp frame

You can change the corner style.

python
# Default is "rounded".
stylesheet = qdarktheme.setup_theme(corner_shape="sharp")

QPalette and stylesheet

You can also only load QPalette and stylesheet. qdarktheme.setup_theme uses the following functions internally.

python
palette = qdarktheme.load_palette(theme="dark")
stylesheet = qdarktheme.load_stylesheet(theme="dark")

Example

To check all Qt widgets, run:

python -m qdarktheme.widget_gallery

License

The svg files for the PyQtDarkTheme are derived Material design icons(Apache License Version 2.0). Qt stylesheets are originally fork of QDarkStyleSheet(MIT License). Other files are covered by PyQtDarkTheme's MIT license. The accent detector(qdarktheme/_os_appearance/_accent/_mac_detect) is inspired by darkdetect(3-clause BSD License).

Contributing

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome. You can get started by reading this:

  • Contributing Guide

Change log

See Releases.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythondark-themedarkthemepyqtpyqt5

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具