Move notification of layout change up from QApplication to QGuiApplication.

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 <Friedemann.Kleint@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
This commit is contained in:
Robin Burchell 2013-12-05 02:43:53 +01:00 committed by The Qt Project
parent 7009843ae3
commit 2f284d3632
3 changed files with 5 additions and 11 deletions

View File

@ -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 *)

View File

@ -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)

View File

@ -116,7 +116,6 @@ public:
QApplicationPrivate(int &argc, char **argv, int flags);
~QApplicationPrivate();
virtual void notifyLayoutDirectionChange();
virtual void notifyActiveWindowChange(QWindow *);
virtual bool shouldQuit();