From 68dc5b90c04058ff8d940c093528effa80ac7e4a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 21 Oct 2011 10:59:27 +0200 Subject: Add virtual QWindow::focusObject() method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The method allows to retrieve the object that currently has the input focus inside the Window. This is e.g. required to correctly determine the context for keyboard shortcuts. Change-Id: I9e05ef62717973bac275ce34cc70fb86aa2d1e5b Reviewed-by: Samuel Rødal --- src/gui/kernel/qwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gui/kernel/qwindow.cpp') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 04098b44c8..80666b87d2 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -663,6 +663,15 @@ QAccessibleInterface *QWindow::accessibleRoot() const return 0; } +/*! + Returns the QObject that will be the final receiver of events tied focus, such + as key events. +*/ +QObject *QWindow::focusObject() const +{ + return const_cast(this); +} + void QWindow::showMinimized() { -- cgit v1.2.3