aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem.cpp
diff options
context:
space:
mode:
authorDaiwei Li <daiweili@suitabletech.com>2013-08-09 12:04:41 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-14 23:46:54 +0200
commit430db1a845836e71074272727d6ab9411d24afd3 (patch)
tree2b5722140fd12902810db05d7df118340d4b5fbb /src/quick/items/qquickitem.cpp
parent2311e4001813b827f2605375253d5b4a23c2ed66 (diff)
Unset the cursor when an Item is unparented
It's possible for a cursor to get stuck if an item gets deleted. QQuickItemPrivate::derefWindow sets the cursorItem in QQuickWindowPrivate to 0, but doesn't unset the cursor. This causes the cursor to get stuck until the user hovers their mouse over an item that has a cursor set. Change-Id: I1d5d3ff13d69c76e4f8fe86b1f5b669bb714ecca Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r--src/quick/items/qquickitem.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 5863c52e70..547b795cd8 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2565,8 +2565,10 @@ void QQuickItemPrivate::derefWindow()
if (c->mouseGrabberItem == q)
c->mouseGrabberItem = 0;
#ifndef QT_NO_CURSOR
- if (c->cursorItem == q)
+ if (c->cursorItem == q) {
c->cursorItem = 0;
+ window->unsetCursor();
+ }
#endif
c->hoverItems.removeAll(q);
if (itemNodeInstance)