equal
deleted
inserted
replaced
741 } |
741 } |
742 |
742 |
743 /** |
743 /** |
744 * is called after a reparent has taken place to fix up the focus chain(s) |
744 * is called after a reparent has taken place to fix up the focus chain(s) |
745 */ |
745 */ |
746 void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *newScene) |
746 void QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *oldScene, QGraphicsScene *newScene) |
747 { |
747 { |
748 Q_Q(QGraphicsWidget); |
748 Q_Q(QGraphicsWidget); |
749 |
749 |
750 Q_ASSERT(focusNext && focusPrev); |
750 Q_ASSERT(focusNext && focusPrev); |
751 |
751 |
787 } |
787 } |
788 |
788 |
789 // update tabFocusFirst for oldScene if the item is going to be removed from oldScene |
789 // update tabFocusFirst for oldScene if the item is going to be removed from oldScene |
790 if (newParent) |
790 if (newParent) |
791 newScene = newParent->scene(); |
791 newScene = newParent->scene(); |
792 QGraphicsScene *oldScene = q->scene(); |
792 |
793 if (oldScene && newScene != oldScene) |
793 if (oldScene && newScene != oldScene) |
794 oldScene->d_func()->tabFocusFirst = firstOld; |
794 oldScene->d_func()->tabFocusFirst = firstOld; |
795 |
795 |
796 QGraphicsItem *topLevelItem = newParent ? newParent->topLevelItem() : 0; |
796 QGraphicsItem *topLevelItem = newParent ? newParent->topLevelItem() : 0; |
797 QGraphicsWidget *topLevel = 0; |
797 QGraphicsWidget *topLevel = 0; |