From e79d975be4976b824a5c29ef005162f0e72f4f67 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 26 Apr 2012 09:33:16 +0200 Subject: [PATCH] Replace QGuiApplication::activeWindow by focusWindow(). Fix deprecation warnings. Change-Id: I8d33aa8c035df6f5ef3fff6a402e980e43e03406 Reviewed-by: Friedemann Kleint --- src/gui/accessible/qaccessibleobject.cpp | 2 +- src/gui/kernel/qguiapplication.cpp | 2 +- src/gui/kernel/qinputmethod.cpp | 2 +- src/testlib/qtestkeyboard.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index db4ee242ff..22c8ba5321 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -243,7 +243,7 @@ QAccessibleInterface *QAccessibleApplication::child(int index) const /*! \reimp */ QAccessibleInterface *QAccessibleApplication::focusChild() const { - if (QWindow *window = QGuiApplication::activeWindow()) + if (QWindow *window = QGuiApplication::focusWindow()) return window->accessibleRoot(); return 0; } diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index fac466b0fd..91c2a9d99b 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1248,7 +1248,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE QWindow *window = e->window.data(); modifier_buttons = e->modifiers; if (e->nullWindow) - window = QGuiApplication::activeWindow(); + window = QGuiApplication::focusWindow(); if (!window) return; if (window->d_func()->blockedByModalWindow) { diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp index c443a47cac..1144c798e2 100644 --- a/src/gui/kernel/qinputmethod.cpp +++ b/src/gui/kernel/qinputmethod.cpp @@ -112,7 +112,7 @@ void QInputMethod::setInputItem(QObject *inputItem) */ QWindow *QInputMethod::inputWindow() const { - return qApp->activeWindow(); + return qApp->focusWindow(); } /*! diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h index 5625bd606c..2e43e864d5 100644 --- a/src/testlib/qtestkeyboard.h +++ b/src/testlib/qtestkeyboard.h @@ -91,7 +91,7 @@ namespace QTest QTEST_ASSERT(qApp); if (!window) - window = QGuiApplication::activeWindow(); + window = QGuiApplication::focusWindow(); QTEST_ASSERT(window);