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
-
pyqt-svg-button - To exclude svg icon set button, also known as
SvgButton. It should use its own style or else svg icon will be disappeared by overwritten style.
Usage
StyleSetter.setWindowStyle(main_window: QWidget, theme: str = 'dark', exclude_type_lst: list = [])-main_windowis the widget which user want to set the style.exclude_type_lst's items are excluded from applying style. Item type should betype(ex.QAbstractButton). Currently it only works forQAbstractButton.
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_()
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_()
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_()
For those who use macOS
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)
| File | Size | Uploaded | |
|---|---|---|---|
| pyqt-style-setter-0.0.15.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|