Skip to main content

A modern, clean, and professional Qt stylesheet with icons for PyQt5/PyQt6/PySide2/PySide6 applications

Project description

Qt Modern Style

A modern, clean, and professional Qt stylesheet with icons for PyQt5/PyQt6/PySide2/PySide6 applications.

Python Version License

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 widgets
  • widget_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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qt_modern_style-2.0.1.tar.gz (392.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qt_modern_style-2.0.1-py3-none-any.whl (582.3 kB view details)

Uploaded Python 3

File details

Details for the file qt_modern_style-2.0.1.tar.gz.

File metadata

  • Download URL: qt_modern_style-2.0.1.tar.gz
  • Upload date:
  • Size: 392.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for qt_modern_style-2.0.1.tar.gz
Algorithm Hash digest
SHA256 8ca4f5fa4bd35ee4bc83c7ef5ac7b942736fadb2518fe28f7e841faf623c069f
MD5 2f090c7205d1e96624cb752455854f77
BLAKE2b-256 7ced703295a331ee59861b43ed40e0192d989409c8f6498558f716cd644ad909

See more details on using hashes here.

File details

Details for the file qt_modern_style-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for qt_modern_style-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b9a6f611b21a6a3520922497e74dd80fc911658adf0c7f4ab90fdefadc56fd6
MD5 cb4249cf3f1b28413943a8b1bf322857
BLAKE2b-256 7dd43aec9bc7aaa9119212e3b55546d9679b5d2f4a46fe5ba57ac666eb8156f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page