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-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_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.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56489a215552a3c9a0a4fd1124102baf1a28e8019e81bee30adb9d11abae02b7 |
|
MD5 | 5c6eb31d06bf156d2ae68234e5be00e7 |
|
BLAKE2b-256 | 58aabcee828868b3b2880378f5325eddb54dd3941679f57329ae19106ead8ac7 |