src/gui/graphicsview/qgraphicsitem.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
  1451     d_ptr->removeExtraItemCache();
  1451     d_ptr->removeExtraItemCache();
  1452 
  1452 
  1453 #ifndef QT_NO_GESTURES
  1453 #ifndef QT_NO_GESTURES
  1454     if (d_ptr->isObject && !d_ptr->gestureContext.isEmpty()) {
  1454     if (d_ptr->isObject && !d_ptr->gestureContext.isEmpty()) {
  1455         QGraphicsObject *o = static_cast<QGraphicsObject *>(this);
  1455         QGraphicsObject *o = static_cast<QGraphicsObject *>(this);
  1456         QGestureManager *manager = QGestureManager::instance();
  1456         if (QGestureManager *manager = QGestureManager::instance()) {
  1457         foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
  1457             foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
  1458             manager->cleanupCachedGestures(o, type);
  1458                 manager->cleanupCachedGestures(o, type);
       
  1459         }
  1459     }
  1460     }
  1460 #endif
  1461 #endif
  1461 
  1462 
  1462     clearFocus();
  1463     clearFocus();
  1463 
  1464 
  3256 
  3257 
  3257     // Update focus scope item ptr.
  3258     // Update focus scope item ptr.
  3258     QGraphicsItem *p = parent;
  3259     QGraphicsItem *p = parent;
  3259     while (p) {
  3260     while (p) {
  3260         if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
  3261         if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
       
  3262             QGraphicsItem *oldFocusScopeItem = p->d_ptr->focusScopeItem;
  3261             p->d_ptr->focusScopeItem = q_ptr;
  3263             p->d_ptr->focusScopeItem = q_ptr;
  3262             if (!p->focusItem() && !focusFromShow) {
  3264             if (!p->focusItem() && !focusFromShow) {
       
  3265                 if (oldFocusScopeItem)
       
  3266                     oldFocusScopeItem->d_ptr->focusScopeItemChange(false);
       
  3267                 focusScopeItemChange(true);
  3263                 // If you call setFocus on a child of a focus scope that
  3268                 // If you call setFocus on a child of a focus scope that
  3264                 // doesn't currently have a focus item, then stop.
  3269                 // doesn't currently have a focus item, then stop.
  3265                 return;
  3270                 return;
  3266             }
  3271             }
  3267             break;
  3272             break;
  3928     \since 4.6
  3933     \since 4.6
  3929 
  3934 
  3930     Returns a list of graphics transforms that currently apply to this item.
  3935     Returns a list of graphics transforms that currently apply to this item.
  3931 
  3936 
  3932     QGraphicsTransform is for applying and controlling a chain of individual
  3937     QGraphicsTransform is for applying and controlling a chain of individual
  3933     transformation operations on an item. It's particularily useful in
  3938     transformation operations on an item. It's particularly useful in
  3934     animations, where each transform operation needs to be interpolated
  3939     animations, where each transform operation needs to be interpolated
  3935     independently, or differently.
  3940     independently, or differently.
  3936 
  3941 
  3937     The transformations are combined with the item's rotation(), scale() and
  3942     The transformations are combined with the item's rotation(), scale() and
  3938     transform() to map the item's coordinate system to the parent item.
  3943     transform() to map the item's coordinate system to the parent item.
  3955     If all you want is to rotate or scale an item, you should call setRotation()
  3960     If all you want is to rotate or scale an item, you should call setRotation()
  3956     or setScale() instead. If you want to set an arbitrary transformation on
  3961     or setScale() instead. If you want to set an arbitrary transformation on
  3957     an item, you can call setTransform().
  3962     an item, you can call setTransform().
  3958 
  3963 
  3959     QGraphicsTransform is for applying and controlling a chain of individual
  3964     QGraphicsTransform is for applying and controlling a chain of individual
  3960     transformation operations on an item. It's particularily useful in
  3965     transformation operations on an item. It's particularly useful in
  3961     animations, where each transform operation needs to be interpolated
  3966     animations, where each transform operation needs to be interpolated
  3962     independently, or differently.
  3967     independently, or differently.
  3963 
  3968 
  3964     The transformations are combined with the item's rotation(), scale() and
  3969     The transformations are combined with the item's rotation(), scale() and
  3965     transform() to map the item's coordinate system to the parent item.
  3970     transform() to map the item's coordinate system to the parent item.
  5149     coordinate region.
  5154     coordinate region.
  5150 
  5155 
  5151     The bounding region describes a coarse outline of the item's visual
  5156     The bounding region describes a coarse outline of the item's visual
  5152     contents. Although it's expensive to calculate, it's also more precise
  5157     contents. Although it's expensive to calculate, it's also more precise
  5153     than boundingRect(), and it can help to avoid unnecessary repainting when
  5158     than boundingRect(), and it can help to avoid unnecessary repainting when
  5154     an item is updated. This is particularily efficient for thin items (e.g.,
  5159     an item is updated. This is particularly efficient for thin items (e.g.,
  5155     lines or simple polygons). You can tune the granularity for the bounding
  5160     lines or simple polygons). You can tune the granularity for the bounding
  5156     region by calling setBoundingRegionGranularity(). The default granularity
  5161     region by calling setBoundingRegionGranularity(). The default granularity
  5157     is 0; in which the item's bounding region is the same as its bounding
  5162     is 0; in which the item's bounding region is the same as its bounding
  5158     rect.
  5163     rect.
  5159 
  5164 
  5592     Subclasses can reimplement this function to be notified when an item
  5597     Subclasses can reimplement this function to be notified when an item
  5593     becomes a focusScopeItem (or is no longer a focusScopeItem).
  5598     becomes a focusScopeItem (or is no longer a focusScopeItem).
  5594 */
  5599 */
  5595 void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem)
  5600 void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem)
  5596 {
  5601 {
       
  5602     Q_UNUSED(isSubFocusItem);
  5597 }
  5603 }
  5598 
  5604 
  5599 /*!
  5605 /*!
  5600     \internal
  5606     \internal
  5601 
  5607 
  5657         }
  5663         }
  5658         // Only invalidate cache; item is already dirty.
  5664         // Only invalidate cache; item is already dirty.
  5659         if (d_ptr->fullUpdatePending)
  5665         if (d_ptr->fullUpdatePending)
  5660             return;
  5666             return;
  5661     }
  5667     }
  5662 
       
  5663     if (d_ptr->discardUpdateRequest())
       
  5664         return;
       
  5665 
  5668 
  5666     if (d_ptr->scene)
  5669     if (d_ptr->scene)
  5667         d_ptr->scene->d_func()->markDirty(this, rect);
  5670         d_ptr->scene->d_func()->markDirty(this, rect);
  5668 }
  5671 }
  5669 
  5672 
  7748   Reimplemented by QGraphicsWidget
  7751   Reimplemented by QGraphicsWidget
  7749 */
  7752 */
  7750 void QGraphicsItemPrivate::resetHeight()
  7753 void QGraphicsItemPrivate::resetHeight()
  7751 {
  7754 {
  7752 }
  7755 }
       
  7756 
       
  7757 /*!
       
  7758     \property QGraphicsObject::children
       
  7759     \since 4.7
       
  7760     \internal
       
  7761 */
       
  7762 
       
  7763 /*!
       
  7764     \property QGraphicsObject::width
       
  7765     \since 4.7
       
  7766     \internal
       
  7767 */
       
  7768 
       
  7769 /*!
       
  7770     \property QGraphicsObject::height
       
  7771     \since 4.7
       
  7772     \internal
       
  7773 */
  7753 
  7774 
  7754 /*!
  7775 /*!
  7755   \property QGraphicsObject::parent
  7776   \property QGraphicsObject::parent
  7756   \brief the parent of the item
  7777   \brief the parent of the item
  7757 
  7778