frameworks: reenable the updateColorPalette slot

Review Request #114619 - Created Dec. 22, 2013 and submitted

Michal Humpula
This is a little bit hackish, so second opinion is welcomed (required).

Back in KDE4 there was KGlobalSettings::kdisplayPaletteChanged() signal, which was generated, when DBus notification from kcontrol (?) arrived. Seems that with Qt5 QPA and its implementation in frameworks, this is gone. The recommended way is supossedly to

* Note: If you derive from a QWidget-based class, a faster method is to
*       reimplement QWidget::changeEvent() and catch QEvent::PaletteChange.
*       This is the preferred way to get informed about palette updates.

which doesn't work in a case of KateGlobal, which derives from QObject. So Loooking at the Qt5 kode, the QPA should send QEvent::ChangePallete to application object, which resends it to all widgets and to itself as QEvent::ApplicationChangePallete. So the solution simple taps to the event interface and listens for the right event.
none. `kcmshell5 colors` doesn't seems to change colors of running applications (at least for me and for now).


  • 1
  • 0
  • 0
  • 1
Description From Last Updated
Maybe we should call qApp->removeEventFilter(this) in the destructor (mainly for consistency)? Dominik Haumann Dominik Haumann
Dominik Haumann
Commit Hook
This review has been submitted with commit 7771ac6b705a2bda7721d164b59ce6b50c1b4a38 by Michal Humpula to branch frameworks.
Michal Humpula
Review request changed

Status: Closed (submitted)