Make PyQt application consistently react to system dark mode

48 views Asked by At

I am writing an application in PyQt on Ubuntu. I would like my gui to react to the system theme: dark or light mode. This functionality should work on both windows and linux environments if possible. How might this be done? Does PyQt automatically detect the system theme? On certain (linux) computers, the gui turns to dark mode by itself in accordance with the os theme, but not consistently on other computers. I would like to control this process in my code so that it is repeatable and consistent on any windows or linux machine. Note: I am not trying to set a dark and light stylesheet for every single widget in my application. It turns out that not all widgets can be properly styled for all modes of interaction (for example, disabled combobox up/down arrows cannot be styled this way). The gui seems to have the capability to change to dark mode automatically when certain os's set their system theme. How can I utilize this to control the theme of my application? How can I make it repeatable and consistent on both linux and windows os's?

0

There are 0 answers