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).
Requirements
- PyQt5 >= 5.8
Setup
python -m pip install pyqt-style-setter
Included Packages
-
pyqt-svg-icon-pushbutton - To exclude svg icon set
QPushButton
, also known asSvgIconPushButton
. 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_window
is 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_()
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
Built Distribution
Close
Hashes for pyqt_style_setter-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f767e5aad4a3a52bd3dc510327bf0af2f5770a8fb39523c517fc5ae0b5effdf |
|
MD5 | 3fd07f1f01fa9e03520970c0d9a145e9 |
|
BLAKE2b-256 | dc06d482469bbc54de82e11480f3640446477e2de8ddc22fa5bd06eb73a374b7 |