Fix a regression in 4.10 that prevented dark mode from working because of a change in Qt behavior

This commit is contained in:
Kovid Goyal 2020-02-07 10:19:03 +05:30
parent 69357d7a73
commit e0b74b5082
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1069,8 +1069,10 @@ class Application(QApplication):
self.ignore_palette_changes = True
self.setPalette(pal)
# Needed otherwise Qt does not emit the paletteChanged signal when
# appearance is changed.
self.setAttribute(Qt.AA_SetPalette, False)
# appearance is changed. And it has to be after current event
# processing finishes as of Qt 5.14 otherwise the palette change is
# ignored.
QTimer.singleShot(1000, lambda: QApplication.instance().setAttribute(Qt.AA_SetPalette, False))
self.ignore_palette_changes = False
def on_palette_change(self):