
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
A comprehensive theme management library for PyQt5/PyQt6/PySide6 applications
A comprehensive theme management library for PyQt5/PyQt6/PySide6 applications, providing dynamic theme switching with an advanced theme editor and 16+ built-in themes.
--config
and --theme
optionstheme-editor
, theme-preview
commands for easy launchingWant to try the NEW zebra pattern auto-generation?
# Install and launch integrated theme editor with zebra patterns
pip install qt-theme-manager[pyqt6]
python launch_zebra_theme_editor.py --mode full
# Or try the standalone zebra pattern editor
python launch_zebra_theme_editor.py --mode standalone
# Demo the zebra generation capabilities
python launch_zebra_theme_editor.py --mode demo
Want to try the enhanced theme editor?
# Launch theme editor (New entry points!)
theme-editor
# Alternative launch methods (all work reliably):
python -m theme_manager.qt.theme_editor
python launch_theme_editor.py # If you cloned the repo
Want to add beautiful themes to your Qt app in just 3 lines of code?
from theme_manager.qt.controller import apply_theme_to_widget
# That's it! Apply current theme to any widget:
apply_theme_to_widget(your_widget)
Want to switch themes dynamically?
from theme_manager.qt.controller import ThemeController
controller = ThemeController()
controller.set_theme("dark") # or "light", "blue", "cyberpunk", etc.
controller.apply_theme_to_application()
16 beautiful themes ready to use: dark
, light
, blue
, green
, cyberpunk
, ocean
, and more!
# Basic installation
pip install qt-theme-manager
# Install with your preferred Qt framework (Enhanced compatibility in v0.2.1!)
pip install qt-theme-manager[pyqt6] # For PyQt6 (recommended)
pip install qt-theme-manager[pyqt5] # For PyQt5
pip install qt-theme-manager[pyside6] # For PySide6
# Install with all Qt frameworks
pip install qt-theme-manager[all]
✨ New in v0.2.1: Enhanced Qt framework compatibility ensures reliable operation across PyQt5, PyQt6, and PySide6.
git clone https://github.com/scottlz0310/Qt-Theme-Manager.git
cd Qt-Theme-Manager
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Linux/Mac
# or: venv\Scripts\activate # Windows
# Install with your preferred Qt framework
pip install -e .[pyqt6] # For PyQt6
# pip install -e .[pyqt5] # For PyQt5
# pip install -e .[pyside6] # For PySide6
from theme_manager.qt.controller import apply_theme_to_widget
from PyQt5.QtWidgets import QApplication, QMainWindow
app = QApplication([])
window = QMainWindow()
# Apply current theme to widget
apply_theme_to_widget(window)
window.show()
app.exec_()
from theme_manager.qt.controller import ThemeController
# Initialize theme controller
controller = ThemeController()
# Get available themes
themes = controller.get_available_themes()
print("Available themes:", list(themes.keys()))
# Switch theme
controller.set_theme("dark")
# Apply to application
controller.apply_theme_to_application()
After installing via pip, you can use these convenient GUI tools:
# Launch the advanced theme editor
theme-editor
# Launch theme preview window
theme-preview
# NEW: Launch zebra pattern theme editor (integrated mode)
python launch_zebra_theme_editor.py --mode full
# NEW: Launch standalone zebra pattern editor
python launch_zebra_theme_editor.py --mode standalone
# NEW: Demo zebra pattern generation capabilities
python launch_zebra_theme_editor.py --mode demo
# Enhanced preview with custom configuration and theme (v0.2.3)
theme-preview --config custom_themes.json --theme ocean
theme-preview --config accessibility_themes.json --theme orange
theme-preview -c my_themes.json -t dark
# Use CLI tools
theme-manager --help
The theme-preview
command now supports flexible options:
--config
, -c
: Specify custom theme configuration file (JSON format)--theme
, -t
: Set initial theme to apply on startup--help
, -h
: Show help message with usage examples# Preview with default themes
theme-preview
# Use custom accessibility-improved themes
theme-preview --config accessibility_themes.json
# Start with specific theme
theme-preview --theme amber
# Combine custom config and theme
theme-preview --config my_improved_themes.json --theme "Orange (Improved)"
Qt-Theme-Manager now provides enhanced accessibility features:
# Enable zebra stripes with improved accessibility
list_widget.setAlternatingRowColors(True)
controller.apply_theme_to_widget(list_widget)
# Colors are automatically optimized for accessibility
For advanced users or scripting:
# New entry points (recommended)
theme-manager list
theme-manager set dark
theme-manager export dark dark_theme.qss
theme-manager current
# Legacy methods
python -m theme_manager.cli.main list
python -m theme_manager.cli.main set dark
python -m theme_manager.cli.main export dark dark_theme.qss
python -m theme_manager.cli.main current
python -m theme_manager.main current
The library includes 16 built-in themes:
Themes are defined in config/theme_settings.json
. Each theme includes:
{
"dark": {
"name": "dark",
"display_name": "ダークモード",
"description": "暗い背景の低負荷テーマ",
"backgroundColor": "#1a1a1a",
"textColor": "#eeeeee",
"primaryColor": "#222831",
"accentColor": "#00adb5",
"button": {
"background": "#4a5568",
"text": "#ffffff",
"hover": "#00adb5"
}
}
}
from theme_manager.qt.controller import ThemeController
# Use custom config file
controller = ThemeController("/path/to/custom/config.json")
from theme_manager.qt.preview import show_preview
# Show interactive preview window
preview_window = show_preview()
from theme_manager.qt.stylesheet import StylesheetGenerator
theme_config = {...} # Your theme configuration
generator = StylesheetGenerator(theme_config)
# Generate complete stylesheet
qss = generator.generate_qss()
# Generate specific widget styles
button_qss = generator.generate_widget_qss('button')
theme_manager/
├── __init__.py # Main package exports
├── config/
│ └── theme_settings.json # Theme definitions
├── qt/
│ ├── __init__.py
│ ├── loader.py # JSON configuration loader
│ ├── stylesheet.py # QSS generation
│ ├── controller.py # Theme management
│ └── preview.py # GUI preview window
├── cli/
やえ│ ├── __init__.py
│ └── themectl.py # CLI interface
└── main.py # CLI entry point
Run the test suite to verify functionality:
python test_theme_manager.py
This will test:
Main class for theme management.
get_available_themes()
- Get all available themesget_current_theme_name()
- Get current active themeset_theme(theme_name, save_settings=True)
- Switch to specified themeapply_theme_to_widget(widget)
- Apply theme to specific widgetapply_theme_to_application(app=None)
- Apply theme to entire applicationexport_qss(output_path, theme_name=None)
- Export QSS to fileHandles loading and saving theme configurations.
load_settings()
- Load theme configuration from fileget_available_themes()
- Get available themes dictget_current_theme()
- Get current theme nameupdate_current_theme(theme_name)
- Update and save current themeGenerates QSS stylesheets from theme configurations.
generate_qss()
- Generate complete QSS stylesheetgenerate_widget_qss(widget_type)
- Generate QSS for specific widget typevalidate_theme_config(theme_config)
- Validate theme configuration[Add your license information here]
[Add contribution guidelines here]
FAQs
A comprehensive theme management library for PyQt5/PyQt6/PySide6 applications
We found that qt-theme-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.