diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-06-17 00:26:13 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-06-17 00:26:13 (GMT) |
commit | 7a577ff67388413a882435c5cbd1ad6d1fa8393d (patch) | |
tree | 61930e61163295b31a542f76e2111dbcc2f5d138 | |
parent | ec733c88ff54a2d7bebb0e5e471f40711ece3d5b (diff) | |
download | Qt-7a577ff67388413a882435c5cbd1ad6d1fa8393d.zip Qt-7a577ff67388413a882435c5cbd1ad6d1fa8393d.tar.gz Qt-7a577ff67388413a882435c5cbd1ad6d1fa8393d.tar.bz2 |
clearFocus() shouldn't mess with focus if it doesn't have focus
removing an item from the view caused the focus to change even if
the removed item didn't have focus.
Task-number: QTBUG-11341
Reviewed-by: Yoann Lopes
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 8042c46..c9176d1 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3277,7 +3277,8 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim */ void QGraphicsItem::clearFocus() { - d_ptr->clearFocusHelper(/* giveFocusToParent = */ true); + if (hasFocus()) + d_ptr->clearFocusHelper(/* giveFocusToParent = */ true); } /*! |