From 2f284d3632cb786446b0b95bf30afdaaf2c1a7ff Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 5 Dec 2013 02:43:53 +0100 Subject: [PATCH] Move notification of layout change up from QApplication to QGuiApplication. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QGuiApplication-using things (like QtQuick) need to know about this, too -- this makes QGuiApplication::setLayoutDirection actually work. Task-number: QTBUG-21573 Change-Id: I2d2ac7dc07f11be5c7e501a3575b1d0978d8ac31 Reviewed-by: Friedemann Kleint Reviewed-by: Jan Arve Sæther --- src/gui/kernel/qguiapplication.cpp | 5 +++++ src/widgets/kernel/qapplication.cpp | 10 ---------- src/widgets/kernel/qapplication_p.h | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index bc4a135e03..1db252ca61 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2548,6 +2548,11 @@ void QGuiApplication::setFont(const QFont &font) void QGuiApplicationPrivate::notifyLayoutDirectionChange() { + const QWindowList list = QGuiApplication::topLevelWindows(); + for (int i = 0; i < list.size(); ++i) { + QEvent ev(QEvent::ApplicationLayoutDirectionChange); + QCoreApplication::sendEvent(list.at(i), &ev); + } } void QGuiApplicationPrivate::notifyActiveWindowChange(QWindow *) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 9056ffe461..d8c37d6ca0 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1888,16 +1888,6 @@ bool QApplication::event(QEvent *e) \obsolete */ -void QApplicationPrivate::notifyLayoutDirectionChange() -{ - QWidgetList list = QApplication::topLevelWidgets(); - for (int i = 0; i < list.size(); ++i) { - QWidget *w = list.at(i); - QEvent ev(QEvent::ApplicationLayoutDirectionChange); - QCoreApplication::sendEvent(w, &ev); - } -} - /*! \fn void QApplication::setActiveWindow(QWidget* active) diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 29c6902c78..860e89bb4f 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -116,7 +116,6 @@ public: QApplicationPrivate(int &argc, char **argv, int flags); ~QApplicationPrivate(); - virtual void notifyLayoutDirectionChange(); virtual void notifyActiveWindowChange(QWindow *); virtual bool shouldQuit();