Skip to main content

pyqt-style-setter

PyQt style setter

Note

Currently the only style you can set is dark-gray(pyqt-dark-gray-theme), light-gray(pyqt-light-gray-theme).

Requirements

  • PyQt5 >= 5.8

Setup

python -m pip install pyqt-style-setter

Included Packages

Usage

  • StyleSetter.setWindowStyle(main_window: QWidget, theme: str = 'dark', exclude_type_lst: list = []) - main_window is the widget which user want to set the style. exclude_type_lst's items are excluded from applying style. Item type should be type(ex. QAbstractButton). Currently it only works for QAbstractButton.

Example

※ I use the pyqt-timer's settings dialog as an example.

PyQt default theme

from PyQt5.QtWidgets import QApplication

from pyqt_timer.settingsDialog import SettingsDialog



if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    window = SettingsDialog()

    window.show()

    app.exec_()

image

Dark-gray theme

from PyQt5.QtWidgets import QApplication

from pyqt_style_setter import StyleSetter

from pyqt_timer.settingsDialog import SettingsDialog



if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    window = SettingsDialog()

    StyleSetter.setWindowStyle(window) # add this

    window.show()

    app.exec_()

image

Using this with pyqt-custom-titlebar-setter

from PyQt5.QtWidgets import QApplication

from pyqt_custom_titlebar_setter import CustomTitlebarSetter

from pyqt_style_setter import StyleSetter

from pyqt_timer.settingsDialog import SettingsDialog



if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    dialog = SettingsDialog()

    StyleSetter.setWindowStyle(dialog)

    titleBarWindow = CustomTitlebarSetter.getCustomTitleBarWindow(dialog, icon_filename='settings.svg')

    titleBarWindow.show()

    app.exec_()

image

For those who use macOS

image

Metadata

Release files for pyqt-style-setter 0.0.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyqt-style-setter 0.0.15
File Size Uploaded
pyqt-style-setter-0.0.15.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyqt-style-setter 0.0.15
File Interpreter ABI Platform
pyqt_style_setter-0.0.15-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / pyqt-style-setter-0.0.15.tar.gz

Download URL pyqt-style-setter-0.0.15.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
76c89d541f886df7ddfc1c96ea12934d4ce3a19cd14d56c30839c530c4eb69ec
BLAKE2b-256 checksum
How to use checksums
e44310404a08906c7d36872b22b7013680e468f852d0b47dd406fb540d56d3bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 CPython/3.7.6

Release files / pyqt_style_setter-0.0.15-py3-none-any.whl

Download URL pyqt_style_setter-0.0.15-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c791e9e4a9dc02fa065b0f9085a62e4b8e52ad20f1bcc07d937e29bb4d3ed64f
BLAKE2b-256 checksum
How to use checksums
62c7b7e1d212867a150b23a83f4ee09ad94f206c69c9be6a6d6e36fb7d0be3b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.0.15 This release

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page