Skip to content

Commit 1c256b2

Browse files
author
Qt Continuous Integration System
committed
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: Fix focusScopeItemChange setting crash
2 parents 80cd74a + ee60e9c commit 1c256b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gui/graphicsview/qgraphicsitem.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,6 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
11571157
if (q_ptr == fsi || q_ptr->isAncestorOf(fsi)) {
11581158
parentFocusScopeItem = fsi;
11591159
p->d_ptr->focusScopeItem = 0;
1160-
fsi->d_ptr->focusScopeItemChange(false);
11611160
}
11621161
break;
11631162
}
@@ -1259,6 +1258,10 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
12591258
if (!inDestructor && (transformData || (newParent && newParent->d_ptr->transformData)))
12601259
transformChanged();
12611260

1261+
// Reparenting is finished, now safe to notify the previous focusScopeItem about changes
1262+
if (parentFocusScopeItem)
1263+
parentFocusScopeItem->d_ptr->focusScopeItemChange(false);
1264+
12621265
// Restore the sub focus chain.
12631266
if (subFocusItem) {
12641267
subFocusItem->d_ptr->setSubFocus(newParent);

0 commit comments

Comments
 (0)