Skip to main content

PyQt style setter

Project description

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

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

pyqt-style-setter-0.0.15.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

pyqt_style_setter-0.0.15-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pyqt-style-setter-0.0.15.tar.gz.

File metadata

  • Download URL: pyqt-style-setter-0.0.15.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 CPython/3.7.6

File hashes

Hashes for pyqt-style-setter-0.0.15.tar.gz
Algorithm Hash digest
SHA256 76c89d541f886df7ddfc1c96ea12934d4ce3a19cd14d56c30839c530c4eb69ec
MD5 225fb64645657cff6c673f4c4883ce3b
BLAKE2b-256 e44310404a08906c7d36872b22b7013680e468f852d0b47dd406fb540d56d3bb

See more details on using hashes here.

File details

Details for the file pyqt_style_setter-0.0.15-py3-none-any.whl.

File metadata

File hashes

Hashes for pyqt_style_setter-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 c791e9e4a9dc02fa065b0f9085a62e4b8e52ad20f1bcc07d937e29bb4d3ed64f
MD5 1bd5a6b08e7ba311ebb8577659439c1a
BLAKE2b-256 62c7b7e1d212867a150b23a83f4ee09ad94f206c69c9be6a6d6e36fb7d0be3b0

See more details on using hashes here.

Supported by

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