5223 // number is equal to the size of the children list. |
5223 // number is equal to the size of the children list. |
5224 ensureSequentialSiblingIndex(); |
5224 ensureSequentialSiblingIndex(); |
5225 needSortChildren = 1; // ### maybe 0 |
5225 needSortChildren = 1; // ### maybe 0 |
5226 child->d_ptr->siblingIndex = children.size(); |
5226 child->d_ptr->siblingIndex = children.size(); |
5227 children.append(child); |
5227 children.append(child); |
5228 if (isObject) |
|
5229 emit static_cast<QGraphicsObject *>(q_ptr)->childrenChanged(); |
|
5230 } |
5228 } |
5231 |
5229 |
5232 /*! |
5230 /*! |
5233 \internal |
5231 \internal |
5234 |
5232 |
5247 children.removeOne(child); |
5245 children.removeOne(child); |
5248 // NB! Do not use children.removeAt(child->d_ptr->siblingIndex) because |
5246 // NB! Do not use children.removeAt(child->d_ptr->siblingIndex) because |
5249 // the child is not guaranteed to be at the index after the list is sorted. |
5247 // the child is not guaranteed to be at the index after the list is sorted. |
5250 // (see ensureSortedChildren()). |
5248 // (see ensureSortedChildren()). |
5251 child->d_ptr->siblingIndex = -1; |
5249 child->d_ptr->siblingIndex = -1; |
5252 if (isObject) |
|
5253 emit static_cast<QGraphicsObject *>(q_ptr)->childrenChanged(); |
|
5254 } |
5250 } |
5255 |
5251 |
5256 /*! |
5252 /*! |
5257 \internal |
5253 \internal |
5258 */ |
5254 */ |
7456 QGestureManager *manager = QGestureManager::instance(); |
7452 QGestureManager *manager = QGestureManager::instance(); |
7457 manager->cleanupCachedGestures(this, gesture); |
7453 manager->cleanupCachedGestures(this, gesture); |
7458 } |
7454 } |
7459 } |
7455 } |
7460 |
7456 |
7461 void QGraphicsItemPrivate::append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item) |
|
7462 { |
|
7463 QGraphicsItemPrivate::get(item)->setParentItemHelper(static_cast<QGraphicsObject *>(list->object), /*newParentVariant=*/0, /*thisPointerVariant=*/0); |
|
7464 } |
|
7465 |
|
7466 /*! |
|
7467 Returns a list of this item's children. |
|
7468 |
|
7469 The items are sorted by stacking order. This takes into account both the |
|
7470 items' insertion order and their Z-values. |
|
7471 |
|
7472 */ |
|
7473 QDeclarativeListProperty<QGraphicsObject> QGraphicsItemPrivate::childrenList() |
|
7474 { |
|
7475 Q_Q(QGraphicsItem); |
|
7476 if (isObject) { |
|
7477 QGraphicsObject *that = static_cast<QGraphicsObject *>(q); |
|
7478 return QDeclarativeListProperty<QGraphicsObject>(that, &children, QGraphicsItemPrivate::append); |
|
7479 } else { |
|
7480 //QGraphicsItem is not supported for this property |
|
7481 return QDeclarativeListProperty<QGraphicsObject>(); |
|
7482 } |
|
7483 } |
|
7484 |
|
7485 /*! |
|
7486 \internal |
|
7487 Returns the width of the item |
|
7488 Reimplemented by QGraphicsWidget |
|
7489 */ |
|
7490 qreal QGraphicsItemPrivate::width() const |
|
7491 { |
|
7492 return 0; |
|
7493 } |
|
7494 |
|
7495 /*! |
|
7496 \internal |
|
7497 Set the width of the item |
|
7498 Reimplemented by QGraphicsWidget |
|
7499 */ |
|
7500 void QGraphicsItemPrivate::setWidth(qreal w) |
|
7501 { |
|
7502 Q_UNUSED(w); |
|
7503 } |
|
7504 |
|
7505 /*! |
|
7506 \internal |
|
7507 Reset the width of the item |
|
7508 Reimplemented by QGraphicsWidget |
|
7509 */ |
|
7510 void QGraphicsItemPrivate::resetWidth() |
|
7511 { |
|
7512 } |
|
7513 |
|
7514 /*! |
|
7515 \internal |
|
7516 Returns the height of the item |
|
7517 Reimplemented by QGraphicsWidget |
|
7518 */ |
|
7519 qreal QGraphicsItemPrivate::height() const |
|
7520 { |
|
7521 return 0; |
|
7522 } |
|
7523 |
|
7524 /*! |
|
7525 \internal |
|
7526 Set the height of the item |
|
7527 Reimplemented by QGraphicsWidget |
|
7528 */ |
|
7529 void QGraphicsItemPrivate::setHeight(qreal h) |
|
7530 { |
|
7531 Q_UNUSED(h); |
|
7532 } |
|
7533 |
|
7534 /*! |
|
7535 \internal |
|
7536 Reset the height of the item |
|
7537 Reimplemented by QGraphicsWidget |
|
7538 */ |
|
7539 void QGraphicsItemPrivate::resetHeight() |
|
7540 { |
|
7541 } |
|
7542 |
|
7543 /*! |
7457 /*! |
7544 \property QGraphicsObject::parent |
7458 \property QGraphicsObject::parent |
7545 \brief the parent of the item |
7459 \brief the parent of the item |
7546 |
7460 |
7547 \note The item's parent is set independently of the parent object returned |
7461 \note The item's parent is set independently of the parent object returned |
7724 origin for scale and rotation. |
7638 origin for scale and rotation. |
7725 |
7639 |
7726 \sa scale, rotation, QGraphicsItem::transformOriginPoint() |
7640 \sa scale, rotation, QGraphicsItem::transformOriginPoint() |
7727 */ |
7641 */ |
7728 |
7642 |
7729 /*! |
|
7730 \fn void QGraphicsObject::widthChanged() |
|
7731 \internal |
|
7732 */ |
|
7733 |
|
7734 /*! |
|
7735 \fn void QGraphicsObject::heightChanged() |
|
7736 \internal |
|
7737 */ |
|
7738 |
|
7739 /*! |
|
7740 |
|
7741 \fn QGraphicsObject::childrenChanged() |
|
7742 |
|
7743 This signal gets emitted whenever the children list changes |
|
7744 \internal |
|
7745 */ |
|
7746 |
7643 |
7747 /*! |
7644 /*! |
7748 \class QAbstractGraphicsShapeItem |
7645 \class QAbstractGraphicsShapeItem |
7749 \brief The QAbstractGraphicsShapeItem class provides a common base for |
7646 \brief The QAbstractGraphicsShapeItem class provides a common base for |
7750 all path items. |
7647 all path items. |