src/gui/graphicsview/qgraphicsitem.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
--- a/src/gui/graphicsview/qgraphicsitem.cpp	Fri Sep 17 08:34:18 2010 +0300
+++ b/src/gui/graphicsview/qgraphicsitem.cpp	Mon Oct 04 01:19:32 2010 +0300
@@ -1453,9 +1453,10 @@
 #ifndef QT_NO_GESTURES
     if (d_ptr->isObject && !d_ptr->gestureContext.isEmpty()) {
         QGraphicsObject *o = static_cast<QGraphicsObject *>(this);
-        QGestureManager *manager = QGestureManager::instance();
-        foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
-            manager->cleanupCachedGestures(o, type);
+        if (QGestureManager *manager = QGestureManager::instance()) {
+            foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
+                manager->cleanupCachedGestures(o, type);
+        }
     }
 #endif
 
@@ -3258,8 +3259,12 @@
     QGraphicsItem *p = parent;
     while (p) {
         if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+            QGraphicsItem *oldFocusScopeItem = p->d_ptr->focusScopeItem;
             p->d_ptr->focusScopeItem = q_ptr;
             if (!p->focusItem() && !focusFromShow) {
+                if (oldFocusScopeItem)
+                    oldFocusScopeItem->d_ptr->focusScopeItemChange(false);
+                focusScopeItemChange(true);
                 // If you call setFocus on a child of a focus scope that
                 // doesn't currently have a focus item, then stop.
                 return;
@@ -3930,7 +3935,7 @@
     Returns a list of graphics transforms that currently apply to this item.
 
     QGraphicsTransform is for applying and controlling a chain of individual
-    transformation operations on an item. It's particularily useful in
+    transformation operations on an item. It's particularly useful in
     animations, where each transform operation needs to be interpolated
     independently, or differently.
 
@@ -3957,7 +3962,7 @@
     an item, you can call setTransform().
 
     QGraphicsTransform is for applying and controlling a chain of individual
-    transformation operations on an item. It's particularily useful in
+    transformation operations on an item. It's particularly useful in
     animations, where each transform operation needs to be interpolated
     independently, or differently.
 
@@ -5151,7 +5156,7 @@
     The bounding region describes a coarse outline of the item's visual
     contents. Although it's expensive to calculate, it's also more precise
     than boundingRect(), and it can help to avoid unnecessary repainting when
-    an item is updated. This is particularily efficient for thin items (e.g.,
+    an item is updated. This is particularly efficient for thin items (e.g.,
     lines or simple polygons). You can tune the granularity for the bounding
     region by calling setBoundingRegionGranularity(). The default granularity
     is 0; in which the item's bounding region is the same as its bounding
@@ -5594,6 +5599,7 @@
 */
 void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem)
 {
+    Q_UNUSED(isSubFocusItem);
 }
 
 /*!
@@ -5660,9 +5666,6 @@
             return;
     }
 
-    if (d_ptr->discardUpdateRequest())
-        return;
-
     if (d_ptr->scene)
         d_ptr->scene->d_func()->markDirty(this, rect);
 }
@@ -7752,6 +7755,24 @@
 }
 
 /*!
+    \property QGraphicsObject::children
+    \since 4.7
+    \internal
+*/
+
+/*!
+    \property QGraphicsObject::width
+    \since 4.7
+    \internal
+*/
+
+/*!
+    \property QGraphicsObject::height
+    \since 4.7
+    \internal
+*/
+
+/*!
   \property QGraphicsObject::parent
   \brief the parent of the item