summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-20 00:10:49 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-20 00:10:49 (GMT)
commit4d93a4eccb462ce3bee75f0c3961901d60bcae02 (patch)
tree3b7944c49d296ab48ad543843932fe5cbb905c61 /src
parent70f7a6e7ebec1fca9087fde56ce9961f34a52dc5 (diff)
parentddc7f627d85436d76f5ca881bd6f16efb8962af5 (diff)
downloadQt-4d93a4eccb462ce3bee75f0c3961901d60bcae02.zip
Qt-4d93a4eccb462ce3bee75f0c3961901d60bcae02.tar.gz
Qt-4d93a4eccb462ce3bee75f0c3961901d60bcae02.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Further focus scope fixes. Fix visual test. Fix recording of visual tests.
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 2b6aaf5..7ab49cb 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -3322,8 +3322,7 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim
*/
void QGraphicsItem::clearFocus()
{
- if (hasFocus())
- d_ptr->clearFocusHelper(/* giveFocusToParent = */ true);
+ d_ptr->clearFocusHelper(/* giveFocusToParent = */ true);
}
/*!
@@ -3337,8 +3336,14 @@ void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent)
QGraphicsItem *p = parent;
while (p) {
if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
- p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false,
- /* focusFromHide = */ false);
+ if (p->d_ptr->focusScopeItem == q_ptr) {
+ p->d_ptr->focusScopeItem = 0;
+ if (!q_ptr->hasFocus()) //if it has focus, focusScopeItemChange is called elsewhere
+ focusScopeItemChange(false);
+ }
+ if (q_ptr->hasFocus())
+ p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false,
+ /* focusFromHide = */ false);
return;
}
p = p->d_ptr->parent;
@@ -3346,10 +3351,10 @@ void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent)
}
}
- // Invisible items with focus must explicitly clear subfocus.
- clearSubFocus(q_ptr);
-
if (q_ptr->hasFocus()) {
+ // Invisible items with focus must explicitly clear subfocus.
+ clearSubFocus(q_ptr);
+
// If this item has the scene's input focus, clear it.
scene->setFocusItem(0);
}