gmarull/qtmodern

Example to set theme during runtime.

Closed this issue · 1 comments

wxguy commented

Thanks for the theme. It works perfectly on my system. Now I would like to implement dark and light theme to my application with switch to change from a click of button. How do I do that?

Sorry for a late reply. This is actually already in the example :)

Change theme

def lightTheme(self):
qtmodern.styles.light(QApplication.instance())
def darkTheme(self):
qtmodern.styles.dark(QApplication.instance())

Connect buttons as usual

self.actionLight.triggered.connect(self.lightTheme)
self.actionDark.triggered.connect(self.darkTheme)