diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-16 16:59:33 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-16 16:59:33 +0100 |
commit | 3f3be55835427ea9f1bbcc046e05ee538ca214d7 (patch) | |
tree | 09d1f54d114855c2b06cc505dfbf74c5890c8419 /src/widgets/kernel/qapplication.cpp | |
parent | ae293c1cb220847194fba6dcebdbb9194837bb56 (diff) | |
parent | 9764f8602719676d1fa15e6fd1e7980af16bfc63 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/gui/kernel/qplatformtheme.h
tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
Change-Id: Iecd3343d6a050b8764f78d809c4a1532aeba69e5
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 57a2063b78..be349bfced 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1888,14 +1888,29 @@ bool QApplication::event(QEvent *e) \obsolete */ +// ### FIXME: topLevelWindows does not contain QWidgets without a parent +// until create_sys is called. So we have to override the +// QGuiApplication::notifyLayoutDirectionChange +// to do the right thing. void QApplicationPrivate::notifyLayoutDirectionChange() { - QWidgetList list = QApplication::topLevelWidgets(); + const QWidgetList list = QApplication::topLevelWidgets(); + QWindowList windowList = QGuiApplication::topLevelWindows(); + + // send to all top-level QWidgets for (int i = 0; i < list.size(); ++i) { QWidget *w = list.at(i); + windowList.removeAll(w->windowHandle()); QEvent ev(QEvent::ApplicationLayoutDirectionChange); QCoreApplication::sendEvent(w, &ev); } + + // in case there are any plain QWindows in this QApplication-using + // application, also send the notification to them + for (int i = 0; i < windowList.size(); ++i) { + QEvent ev(QEvent::ApplicationLayoutDirectionChange); + QCoreApplication::sendEvent(windowList.at(i), &ev); + } } /*! |