Changeset View
Changeset View
Standalone View
Standalone View
src/platformtheme/khintssettings.cpp
Show First 20 Lines • Show All 225 Lines • ▼ Show 20 Line(s) | 223 | { | |||
---|---|---|---|---|---|
226 | 226 | | |||
227 | switch (type) { | 227 | switch (type) { | ||
228 | case PaletteChanged: { | 228 | case PaletteChanged: { | ||
229 | loadPalettes(); | 229 | loadPalettes(); | ||
230 | 230 | | |||
231 | //QApplication::setPalette and QGuiApplication::setPalette are different functions | 231 | //QApplication::setPalette and QGuiApplication::setPalette are different functions | ||
232 | //and non virtual. Call the correct one | 232 | //and non virtual. Call the correct one | ||
233 | if (qobject_cast<QApplication *>(QCoreApplication::instance())) { | 233 | if (qobject_cast<QApplication *>(QCoreApplication::instance())) { | ||
234 | QApplication::setPalette(*m_palettes[QPlatformTheme::SystemPalette]); | 234 | QPalette palette = *m_palettes[QPlatformTheme::SystemPalette]; | ||
235 | QApplication::setPalette(palette); | ||||
236 | // QTBUG QGuiApplication::paletteChanged() signal is only emitted by QGuiApplication | ||||
237 | // so things like SystemPalette QtQuick item that use it won't notice a palette | ||||
238 | // change when a QApplication which causes e.g. QML System Settings modules to not update | ||||
239 | emit qApp->paletteChanged(palette); | ||||
235 | } else if (qobject_cast<QGuiApplication *>(QCoreApplication::instance())) { | 240 | } else if (qobject_cast<QGuiApplication *>(QCoreApplication::instance())) { | ||
236 | QGuiApplication::setPalette(*m_palettes[QPlatformTheme::SystemPalette]); | 241 | QGuiApplication::setPalette(*m_palettes[QPlatformTheme::SystemPalette]); | ||
237 | } | 242 | } | ||
238 | break; | 243 | break; | ||
239 | } | 244 | } | ||
240 | case SettingsChanged: { | 245 | case SettingsChanged: { | ||
241 | 246 | | |||
242 | SettingsCategory category = static_cast<SettingsCategory>(arg); | 247 | SettingsCategory category = static_cast<SettingsCategory>(arg); | ||
▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines |