summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-13 17:48:28 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-13 17:48:28 (GMT)
commit213eb572f1902550e36f7e677733aba8d066d94b (patch)
tree923e7cbd96a30ceed95c5a0bdeacf26c38d55659 /src/gui/graphicsview
parentdf28c1203e12c572f795b8d114254a8e5a6619e8 (diff)
parentb5b011a181bd187dcef5ee8f46a3ac2c5dc2e09c (diff)
downloadQt-213eb572f1902550e36f7e677733aba8d066d94b.zip
Qt-213eb572f1902550e36f7e677733aba8d066d94b.tar.gz
Qt-213eb572f1902550e36f7e677733aba8d066d94b.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fixes QGraphicsItem::focusItem() returning incorrect value. Fixes crash in QGraphicsScene::addItem().
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicswidget_p.cpp4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 848de2c..fe2a84e 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -3257,6 +3257,8 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim
}
// Update the child focus chain.
+ if (scene && scene->focusItem())
+ scene->focusItem()->d_ptr->clearSubFocus();
f->d_ptr->setSubFocus();
// Update the scene's focus item.
@@ -7637,9 +7639,9 @@ int QGraphicsItemPrivate::children_count(QDeclarativeListProperty<QGraphicsObjec
QGraphicsObject *QGraphicsItemPrivate::children_at(QDeclarativeListProperty<QGraphicsObject> *list, int index)
{
QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
- if (index >= 0 && index < d->children.count())
+ if (index >= 0 && index < d->children.count())
return d->children.at(index)->toGraphicsObject();
- else
+ else
return 0;
}
diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp
index 28070da..f7850ca 100644
--- a/src/gui/graphicsview/qgraphicswidget_p.cpp
+++ b/src/gui/graphicsview/qgraphicswidget_p.cpp
@@ -761,7 +761,7 @@ void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *new
QGraphicsWidget *firstOld = 0;
bool wasPreviousNew = true;
-
+
while (w != q) {
bool isCurrentNew = q->isAncestorOf(w);
if (isCurrentNew) {
@@ -796,7 +796,7 @@ void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *new
newScene = newParent->scene();
if (oldScene && newScene != oldScene)
- oldScene->d_func()->tabFocusFirst = firstOld;
+ oldScene->d_func()->tabFocusFirst = (firstOld && firstOld->scene() == oldScene) ? firstOld : 0;
QGraphicsItem *topLevelItem = newParent ? newParent->topLevelItem() : 0;
QGraphicsWidget *topLevel = 0;