diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-02-14 11:52:05 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-16 01:56:01 +0100 |
commit | 1747f66457420e970b9402e6418693e17a950a6f (patch) | |
tree | f48f88e150a29cc7953eead0927222ad6e4c68bc /src/gui/kernel/qguiapplication.cpp | |
parent | 394315d902d9068a53439737906c00d48023d182 (diff) |
Add a ThemeChange event.
- Pass it from QWindowSystemInterface via QWindow to the widgets.
- Add handler code from 4.8 / qapplication_win.cpp to qwidget.cpp.
Change-Id: Ic759563aa00cb93fe014c1bf41020446c1927dec
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 5ca6364fbb..4d80aafea5 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -661,6 +661,10 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv QGuiApplicationPrivate::reportLogicalDotsPerInchChange( static_cast<QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *>(e)); break; + case QWindowSystemInterfacePrivate::ThemeChange: + QGuiApplicationPrivate::processThemeChanged( + static_cast<QWindowSystemInterfacePrivate::ThemeChangeEvent *>(e)); + break; case QWindowSystemInterfacePrivate::Map: QGuiApplicationPrivate::processMapEvent(static_cast<QWindowSystemInterfacePrivate::MapEvent *>(e)); break; @@ -888,6 +892,14 @@ void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfa } } +void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce) +{ + if (QWindow *window = tce->window.data()) { + QEvent e(QEvent::ThemeChange); + QGuiApplication::sendSpontaneousEvent(window, &e); + } +} + void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e) { if (e->tlw.isNull()) |