aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-03-12 13:34:19 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-13 10:26:33 +0100
commitd6e932b3682c7f8cd610d7554a52c9856d7e67c1 (patch)
tree6407b097125d7450e2c30d47240331caa76470c6 /src/quick/items
parent6e1851de9595d7e7abe9acdc8c473e792d24c4c2 (diff)
QQuickWindow: let clearFocusObject actually clear the focus object
On iOS we clear the focus object when the virtual keyboard is hidden (to stop blinking cursors etc). The current implementation in QQuickWindow would then tell the root item to clear focus. This was wrong, since setFocus is expected to be called on the item you either want to gain, or release, focus (not the root item). This sometimes caused items to end up in an incorrect focus state. With this patch we ensure that we call setFocus on the focus object. Change-Id: I0c08fbc35f6695064b7c911466fdc62f4027385e Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquickwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 06696437f1..d7a6f071c6 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -880,7 +880,8 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item,
void QQuickWindowPrivate::clearFocusObject()
{
- contentItem->setFocus(false, Qt::OtherFocusReason);
+ if (activeFocusItem)
+ activeFocusItem->setFocus(false, Qt::OtherFocusReason);
}
void QQuickWindowPrivate::notifyFocusChangesRecur(QQuickItem **items, int remaining)