diff options
Diffstat (limited to 'src/gui/accessible')
-rw-r--r-- | src/gui/accessible/qaccessiblewidget.cpp | 13 |
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 ¶ 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)) { |