Giter VIP home page Giter VIP logo

pyqtdarktheme's Introduction

PyQtDarkTheme

Dark theme for PySide and PyQt.

This python module applies a theme to a Qt applications(PySide6, PyQt6, PyQt5) using a qt stylesheets system.
There's a Light Theme too. Color and style balanced from the Dark theme for easy viewing in daylight.

Dark Theme

widget_gallery_dark

Light Theme

widget_gallery_light

Requirements

  • Python 3.9+
  • Windows or MacOS (recommended)
  • PySide6, PyQt6 or PyQt5 (PyQt5 is deprecated)

This module tested on Windows and MacOS. It may work on other operating systems, but it is not guaranteed to work. It also supports PyQt5, but the icons are low quality.

Installation

pip install git+https://github.com/5yutan5/PyQtDarkTheme

This command requires Git.

Usage

import sys

import qdarktheme
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton

app = QApplication(sys.argv)
main_win = QMainWindow()
push_button = QPushButton("PyQtDarkTheme!!")
main_win.setCentralWidget(push_button)

app.setStyleSheet(qdarktheme.load_stylesheet())

main_win.show()

app.exec()

Light theme

app.setStyleSheet(qdarktheme.load_stylesheet("light"))

Check common widgets

Input the following command in a terminal to check common widgets.

python -m qdarktheme.examples.widget_gallery

Custom Properties

This module provides several custom properties.
You can use setProperty() of the widget object to apply a modern style.

For example, if you set the QToolbar type property to sidebar, the style for the sidebar will be applied.

sidebar = QToolBar()
sidebar.setProperty("type", "sidebar")
Widget Property Property value Default Command for demo
QToolBar type toolbar, sidebar toolbar python -m qdarktheme.examples.sidebar
QPushButton type outlined, contained, text outlined python -m qdarktheme.examples.pushbutton
QLineEdit state normal, warning, error normal python -m qdarktheme.examples.lineedit

License

The icons used in the demo code are sourced from the Material design icons(Apache License Version 2.0).

pyqtdarktheme's People

Contributors

5yutan5 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.