diff options
author | Andy Shaw <andy.shaw@qt.io> | 2020-02-13 15:33:00 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2020-02-18 22:11:30 +0100 |
commit | 9029c5586460950b4fa6773a5d08c67e5ba16e8a (patch) | |
tree | 21b0e8ec660dcab699fff06b0251a13289d5684a /src/widgets/kernel/qapplication.cpp | |
parent | 274b6f3c1323a237d04520daacb7212c89d1cb13 (diff) |
Send the LanguageChange event to all top level windows, not just widgets
By sending it to all top level windows it will make it possible for
non widget based controls to listen for this event if it cares about it
so it can handle translation updates as appropriate.
Task-number: QTBUG-78141
Task-number: QTBUG-82020
Change-Id: I8f35cdcccd81a199ff780c3f4f3d2c663480d638
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 2d7919e874..f49461b2d0 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1904,9 +1904,12 @@ bool QApplication::event(QEvent *e) } if(e->type() == QEvent::LanguageChange) { + // QGuiApplication::event does not account for the cases where + // there is a top level widget without a window handle. So they + // need to have the event posted here const QWidgetList list = topLevelWidgets(); for (auto *w : list) { - if (!(w->windowType() == Qt::Desktop)) + if (!w->windowHandle() && (w->windowType() != Qt::Desktop)) postEvent(w, new QEvent(QEvent::LanguageChange)); } } |