summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-06-17 00:26:13 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-06-17 00:26:13 (GMT)
commit7a577ff67388413a882435c5cbd1ad6d1fa8393d (patch)
tree61930e61163295b31a542f76e2111dbcc2f5d138
parentec733c88ff54a2d7bebb0e5e471f40711ece3d5b (diff)
downloadQt-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.cpp3
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);
}
/*!