Qt material theme playground (changing theme during runtime)
- PyQt5
- qt-material
This will work in PyQt6, PySide6 as well.
- git clone ~
- pip install -r requirements.txt
- python main.py
Qt.Material.Theme.Playground.Change.theme.in.Runtime.2024-03-06.09-25-03.mp4
The creator of qt-material prefers to use QtStyleTools but i don't think it is good practice to use multiple inheritence. Beside, changing theme in runtime is perfectly working without using that.
The theme is applied in the dialog as well.
font_size won't work for some reasons. So you have to set font by yourself like this:
QApplication.setFont(QFont('Arial', 12))
If you want to switch font during runtime, you can refer to pyqt-font-dialog.