Skip to content

Qt material theme playground (changing theme during runtime)

License

Notifications You must be signed in to change notification settings

yjg30737/qt-material-theme-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qt-material-theme-playground

Qt material theme playground (changing theme during runtime)

Requirements

  • PyQt5
  • qt-material

This will work in PyQt6, PySide6 as well.

How to Run

  1. git clone ~
  2. pip install -r requirements.txt
  3. python main.py

Preview

Changing theme during runtime

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.

If you press the run button dialog will pop up.

The theme is applied in the dialog as well.

image

Note

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.

Releases

No releases published

Packages

No packages published