summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Millán Soto <fid@gpul.org>2012-01-19 15:15:31 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-01-20 09:35:23 (GMT)
commitb3e18be580bc5eceea00594a62759566b1546d4d (patch)
tree72e67f622ad4e2ca4d26b4294a70668476ff3eaa
parent81df02625ae7c5139fa409d1147a519629b7635c (diff)
downloadQt-b3e18be580bc5eceea00594a62759566b1546d4d.zip
Qt-b3e18be580bc5eceea00594a62759566b1546d4d.tar.gz
Qt-b3e18be580bc5eceea00594a62759566b1546d4d.tar.bz2
Activate window when focus is set in QAccessibleWidget::doAction
Change-Id: Iebdabb30c83d4712ad75ec62ce35b4afc382b613 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
-rw-r--r--src/gui/accessible/qaccessiblewidget.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/accessible/qaccessiblewidget.cpp b/src/gui/accessible/qaccessiblewidget.cpp
index 832f6c8..beb251b 100644
--- a/src/gui/accessible/qaccessiblewidget.cpp
+++ b/src/gui/accessible/qaccessiblewidget.cpp
@@ -888,12 +888,15 @@ bool QAccessibleWidget::doAction(int action, int child, const QVariantList &para
if (action == SetFocus || action == DefaultAction) {
if (child || !widget()->isEnabled())
return false;
- if (widget()->focusPolicy() != Qt::NoFocus)
- widget()->setFocus();
- else if (widget()->isWindow())
- widget()->activateWindow();
- else
+
+ if ((widget()->focusPolicy() == Qt::NoFocus) && (!widget()->isWindow()))
return false;
+
+ if (!widget()->isWindow())
+ widget()->setFocus();
+
+ widget()->activateWindow();
+
return true;
} else if (action > 0) {
if (QAction *act = widget()->actions().value(action - 1)) {