Qt Modern Style
A modern, clean, and professional Qt stylesheet with icons for PyQt5/PyQt6/PySide2/PySide6 applications.
Features
- 🎨 Modern Light Theme - Clean, corporate-style appearance
- 🖼️ 500+ SVG Icons - Comprehensive icon library included
- 🔧 Easy Integration - One-line setup for any Qt application
- 🔄 Cross-Platform - Works with PyQt5, PyQt6, PySide2, and PySide6
- 📦 Zero Dependencies - No external dependencies required
Installation
pip install qt-modern-style
With Qt binding (optional):
# For PyQt5
pip install qt-modern-style[pyqt5]
# For PyQt6
pip install qt-modern-style[pyqt6]
# For PySide2
pip install qt-modern-style[pyside2]
# For PySide6
pip install qt-modern-style[pyside6]
Quick Start
Basic Usage
from PyQt5.QtWidgets import QApplication, QMainWindow
import qt_modern_style
app = QApplication([])
# Apply the modern style to your application
qt_modern_style.apply(app)
window = QMainWindow()
window.setWindowTitle("My Modern App")
window.show()
app.exec_()
Using Icons
from PyQt5.QtWidgets import QApplication, QPushButton
from PyQt5.QtGui import QIcon
import qt_modern_style
app = QApplication([])
qt_modern_style.apply(app)
# Load icons from the package
button = QPushButton()
button.setIcon(qt_modern_style.get_icon("settings")) # or "gear", "save", "close", etc.
button.show()
app.exec_()
Available Functions
import qt_modern_style
# Apply stylesheet to application
qt_modern_style.apply(app)
# Get the stylesheet as string
stylesheet = qt_modern_style.get_stylesheet()
# Load the Qt resources (icons)
qt_modern_style.load_resources()
# Get an icon by name
icon = qt_modern_style.get_icon("save")
# Get icon path
path = qt_modern_style.get_icon_path("save")
# List all available icons
icons = qt_modern_style.list_icons()
# Get the path to the stylesheet file
qss_path = qt_modern_style.get_stylesheet_path()
# Get package directory
pkg_dir = qt_modern_style.get_package_dir()
Primary and Danger Buttons
The stylesheet supports special button styles using Qt properties:
# Primary button (blue accent)
button = QPushButton("Submit")
button.setProperty("primary", True)
# Danger button (red accent)
button = QPushButton("Delete")
button.setProperty("danger", True)
Hint and Muted Labels
# Hint label (darker text)
label = QLabel("This is a hint")
label.setProperty("hint", True)
# Muted label (lighter text)
label = QLabel("This is muted")
label.setProperty("muted", True)
Color Palette
| Token | Color | Usage |
|---|---|---|
| BG | #FFFFFF |
Main background |
| BG-Soft | #F3F6FA |
Secondary background |
| BG-Hover | #EAF0F7 |
Hover states |
| Border | #C9D3DF |
Primary borders |
| Border-2 | #AEBBCD |
Secondary borders |
| Text | #2B3442 |
Primary text |
| Text-2 | #3A4758 |
Secondary text |
| Muted | #98A6B8 |
Disabled/muted text |
| Selection | #DCEBFF |
Selection background |
| Accent | #2F6FED |
Primary accent (blue) |
| Danger | #C23B3B |
Danger/error (red) |
Available Icons
The package includes 500+ modern SVG icons. Some popular icons include:
- Actions:
save,copy,edit,delete,close,add,remove,search,settings - Navigation:
arrow-left,arrow-right,arrow-up,arrow-down,chevron-*,home - Objects:
file,folder,folder-opened,database,cloud,server - Status:
check,error,warning,info,loading - Media:
play,pause,stop,record,mic - Social:
github,twitter,heart - And many more...
To see all available icons:
import qt_modern_style
for icon_name in qt_modern_style.list_icons():
print(icon_name)
Styled Widgets
The stylesheet provides consistent styling for all standard Qt widgets:
- QWidget, QFrame, QGroupBox
- QLabel, QLineEdit, QTextEdit, QPlainTextEdit
- QPushButton, QToolButton
- QCheckBox, QRadioButton
- QComboBox, QSpinBox, QDoubleSpinBox
- QDateEdit, QTimeEdit, QDateTimeEdit
- QTabWidget, QTabBar
- QMenuBar, QMenu
- QStatusBar, QToolBar
- QListView, QTreeView, QTableView
- QScrollBar, QSlider, QProgressBar
- QSplitter, QDialog
- QCalendarWidget
- QToolTip
Examples
Check the examples/ directory for complete working examples:
basic_example.py- Simple application with basic widgetswidget_showcase.py- Showcase of all styled widgets
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for qt-modern-style 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qt_modern_style-2.0.1.tar.gz | 392.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qt_modern_style-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 974.8 kB
Release files / qt_modern_style-2.0.1.tar.gz
| Download URL | qt_modern_style-2.0.1.tar.gz |
|---|---|
| Size | 392.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ca4f5fa4bd35ee4bc83c7ef5ac7b942736fadb2518fe28f7e841faf623c069f
|
|
BLAKE2b-256 checksum How to use checksums |
7ced703295a331ee59861b43ed40e0192d989409c8f6498558f716cd644ad909
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / qt_modern_style-2.0.1-py3-none-any.whl
| Download URL | qt_modern_style-2.0.1-py3-none-any.whl |
|---|---|
| Size | 582.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b9a6f611b21a6a3520922497e74dd80fc911658adf0c7f4ab90fdefadc56fd6
|
|
BLAKE2b-256 checksum How to use checksums |
7dd43aec9bc7aaa9119212e3b55546d9679b5d2f4a46fe5ba57ac666eb8156f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|