diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-04-21 09:47:31 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-05-03 15:31:28 (GMT) |
commit | fe59ef0bf3c8d0ae92c15cd69839df2232a60936 (patch) | |
tree | a8da9987391a5dd761b75fd9346de25381edead7 /src/gui/kernel/qapplication.cpp | |
parent | e4c60e6b8d111c6214d8ee47b8c2bb8b9f8fcfe2 (diff) | |
download | Qt-fe59ef0bf3c8d0ae92c15cd69839df2232a60936.zip Qt-fe59ef0bf3c8d0ae92c15cd69839df2232a60936.tar.gz Qt-fe59ef0bf3c8d0ae92c15cd69839df2232a60936.tar.bz2 |
Propagate LocaleChange event from application to widgets.
The LocaleChange event will be sent to the QApplication object and then
propagated to all widgets down the hierarchy starting with toplevels.
Reviewed-by: Thomas Zander
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index bc58c76..7b62de1 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -2368,6 +2368,19 @@ bool QApplication::event(QEvent *e) if (!(w->windowType() == Qt::Desktop)) postEvent(w, new QEvent(QEvent::LanguageChange)); } +#ifndef Q_OS_WIN + } else if (e->type() == QEvent::LocaleChange) { + // on Windows the event propagation is taken care by the + // WM_SETTINGCHANGE event handler. + QWidgetList list = topLevelWidgets(); + for (int i = 0; i < list.size(); ++i) { + QWidget *w = list.at(i); + if (!(w->windowType() == Qt::Desktop)) { + if (!w->testAttribute(Qt::WA_SetLocale)) + w->d_func()->setLocale_helper(QLocale(), true); + } + } +#endif } else if (e->type() == QEvent::Timer) { QTimerEvent *te = static_cast<QTimerEvent*>(e); Q_ASSERT(te != 0); |