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.0.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.0-py3-none-any.whl (582.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qt_modern_style-2.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 68de17d6bd0eef768f9d442f7f695abc1d3d38729089c87da68c5348ccdf8aad
MD5 7c1b8b7754cf1ef4c83931453ab1fa09
BLAKE2b-256 8c64eaa2ad0a66b337598e00e540be737bb213d4f9e6d16e487ca6361c3a8762

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qt_modern_style-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07e301fc15fce7a4a54da380dfc55e4b6f68adcfaf710ab04b2f81c075fd0cb0
MD5 7e362deebeb11e36480eda2323db7b94
BLAKE2b-256 37d5f7c6862cbf8149a6ec3126b6d869dbe5d9eb8e7a685a978d45190878b138

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