ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

17 November 2022
2022-11-17×
17 November 2022
I just updated from PySide 6.3.2 to 6.4.0.1 and it seems that dark/light mode for the application is automatically applied from system settings. Is there a way to override it and just stick to the light theme?
L
Oh right, I'm talking about a QtWidget based application
A
Lorenzo CastellinoI just updated from PySide 6.3.2 to 6.4.0.1 and it seems that dark/light mode for the application is automatically applied from system settings. Is there a way to override it and just stick to the light theme?
You can invert the app palette with the following code before creating any widgets: palette: QtGui.QPalette = app.palette() cr: QtGui.QPalette.ColorRole for cr in QtGui.QPalette.ColorRole.__members__.values(): if cr == QtGui.QPalette.ColorRole.NColorRoles: continue color: QtGui.QColor = palette.color(cr) color = QtGui.QColor.fromHslF(color.hueF(), color.saturationF(), 1. - color.lightnessF()) palette.setColor(cr, color) app.setPalette(palette)
Lorenzo CastellinoI just updated from PySide 6.3.2 to 6.4.0.1 and it seems that dark/light mode for the application is automatically applied from system settings. Is there a way to override it and just stick to the light theme?
591d8b4cc0 Windows: Turn on dark mode support by default Dark mode, both for the window frames and for the palette, is now supported by default. It can be turned off (partially or entirely) by setting the QPA parameter "darkmode=0" (no dark mode support) or "darkmode=1" (darkmode support only for the window frames).
L
thank you very much
T
I’m currently using this within main, before passing the argv to the QApplication’s __init__ if not os.getenv("QT_QPA_PLUGIN") and "-platform" not in argv and platform.system() == "Windows": argv.append("-platform") argv.append("windows:darkmode=2") You can use darkmode=0 to disable it instead.
T
Keith KyzivatAh someone mentioned it k
As far as I know, the -platform parameter takes precedence over the environment variable. Thus the check to only explicitly set the option if nothing is passed via the environment or explicitly via argv. This still allows the user to override the behaviour, if they wish
Calendar: November 2022
Archive by month
Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog