diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-07-21 02:23:15 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-07-21 02:33:18 (GMT) |
commit | 21806ff0921641b4e4d9d39721ab4ebeae74dddc (patch) | |
tree | 6f854d6279385c120986f0288eb997373058106a /src/gui/graphicsview | |
parent | 4f6e480acce94d8ae920c3eda4879fc4f9cb2598 (diff) | |
download | Qt-21806ff0921641b4e4d9d39721ab4ebeae74dddc.zip Qt-21806ff0921641b4e4d9d39721ab4ebeae74dddc.tar.gz Qt-21806ff0921641b4e4d9d39721ab4ebeae74dddc.tar.bz2 |
QML focus API updates.
The wantsFocus property has been renamed to activeFocus, to better
reflect its value. Reading and writing the focus property is also now
consistent -- this property represents focus within a scope. Other small
changes were made to keep things consistent with the new naming.
Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 12 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem_p.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 6249822..56182d1 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1150,6 +1150,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q if (q_ptr == fsi || q_ptr->isAncestorOf(fsi)) { parentFocusScopeItem = fsi; p->d_ptr->focusScopeItem = 0; + fsi->d_ptr->focusScopeItemChange(false); } break; } @@ -1182,6 +1183,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q while (p) { if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope) { p->d_ptr->focusScopeItem = newFocusScopeItem; + newFocusScopeItem->d_ptr->focusScopeItemChange(true); // Ensure the new item is no longer the subFocusItem. The // only way to set focus on a child of a focus scope is // by setting focus on the scope itself. @@ -5587,6 +5589,16 @@ void QGraphicsItemPrivate::subFocusItemChange() /*! \internal + Subclasses can reimplement this function to be notified when an item + becomes a focusScopeItem (or is no longer a focusScopeItem). +*/ +void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem) +{ +} + +/*! + \internal + Subclasses can reimplement this function to be notified when its siblingIndex order is changed. */ diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 5b9a710..d60dffb 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -482,6 +482,7 @@ public: void clearSubFocus(QGraphicsItem *rootItem = 0); void resetFocusProxy(); virtual void subFocusItemChange(); + virtual void focusScopeItemChange(bool isSubFocusItem); static void children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item); static int children_count(QDeclarativeListProperty<QGraphicsObject> *list); |