Registry / serialization / qdarkstyle

qdarkstyle

JSON →
library3.2.3pypypi✓ verified 87d ago

QDarkStyleSheet (qdarkstyle) provides a comprehensive dark and light stylesheet for C++/Python Qt applications. It offers a consistent, modern theme for your GUI, compatible with both PyQt5 and PySide2. The current version is 3.2.3, and it receives regular minor updates with occasional major releases for significant structural changes and new features.

pip install qdarkstyle
INSTALL
IMPORT
SIG · QDARKSTYLE
Q
qdarkstyle
serializationpythonv3.2.3
Install
1.9s avg
Import
30ms
Disk
22MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v3.2.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.031s · 24MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 1.9s · import 0.029s · 24MB
22MB installed
● package 22MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

load_stylesheet_pyqt5
✓ from qdarkstyle import load_stylesheet_pyqt5
✗ import qdarkstyle app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())

This quickstart demonstrates how to initialize a PyQt5 application and apply the QDarkStyleSheet. Ensure you have PyQt5 (or PySide2) installed alongside qdarkstyle. The example creates a simple window with a button to showcase the applied theme.

import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QVBoxLayout, QWidget from PyQt5.QtCore import Qt import qdarkstyle def main(): app = QApplication(sys.argv) # Apply the dark stylesheet for PyQt5 app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5()) # For PySide2, use: # app.setStyleSheet(qdarkstyle.load_stylesheet_pyside2()) # Create a simple main window main_window = QMainWindow() main_window.setWindowTitle("QDarkStyle Demo") main_window.setGeometry(100, 100, 400, 200) central_widget = QWidget() main_window.setCentralWidget(central_widget) layout = QVBoxLayout(central_widget) button = QPushButton("Styled Button", main_window) layout.addWidget(button, alignment=Qt.AlignCenter) main_window.show() sys.exit(app.exec_()) if __name__ == "__main__": main()
Debug
Known issues
breakingQDarkStyleSheet dropped support for Python 2 and Qt4. Attempting to use it with these older versions will result in errors or unexpected behavior.
fix
Ensure your project uses Python 3.6+ and Qt5 (PyQt5 or PySide2).
affects: >=3.0.0
breakingVersion 3.0.0 introduced a new internal structure, improved dark and new light palettes. If you were relying on deeply integrated custom styling or internal API calls prior to 3.0.0, you might need to adapt your code.
fix
Refer to the official GitHub repository's `example` folder and release notes for `v3.0.0` to understand the new structure and usage patterns. Most common usage (`app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())`) remains compatible.
affects: >=3.0.0
gotchaQDarkStyleSheet provides stylesheets but does not install Qt bindings (PyQt5 or PySide2) itself. You must explicitly install one of these bindings for `qdarkstyle` to function.
fix
Install your preferred Qt binding: `pip install PyQt5` or `pip install PySide2`.
affects: *
gotchaEnsure you are using the correct `load_stylesheet_pyqt5()` or `load_stylesheet_pyside2()` function that matches your installed Qt binding.
fix
If using PyQt5, call `qdarkstyle.load_stylesheet_pyqt5()`. If using PySide2, call `qdarkstyle.load_stylesheet_pyside2()`.
affects: *
Upgrade
Version history
3.2.3latest on PyPI · released Nov 28, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
14
Resources
qdarkstyle — pip install qdarkstyle · libregistry