Changeset 651 for trunk/src/gui/graphicsview/qgraphicsitem_p.h
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/graphicsview/qgraphicsitem_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 154 154 localCollisionHack(0), 155 155 inSetPosHelper(0), 156 needSortChildren( 1), // ### can be 0 by default?156 needSortChildren(0), 157 157 allChildrenDirty(0), 158 158 fullUpdatePending(0), … … 179 179 updateDueToGraphicsEffect(0), 180 180 scenePosDescendants(0), 181 pendingPolish(0), 182 mayHaveChildWithGraphicsEffect(0), 181 183 globalStackingOrder(-1), 182 184 q_ptr(0) … … 196 198 } 197 199 200 void updateChildWithGraphicsEffectFlagRecursively(); 198 201 void updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag, 199 202 AncestorFlag flag = NoFlag, bool enabled = false, bool root = true); 203 void updateAncestorFlags(); 200 204 void setIsMemberOfGroup(bool enabled); 201 205 void remapItemPos(QEvent *event, QGraphicsItem *item); … … 224 228 int depth() const; 225 229 #ifndef QT_NO_GRAPHICSEFFECT 226 void invalidateGraphicsEffectsRecursively(); 230 enum InvalidateReason { 231 OpacityChanged 232 }; 233 void invalidateParentGraphicsEffectsRecursively(); 234 void invalidateChildGraphicsEffectsRecursively(InvalidateReason reason); 227 235 #endif //QT_NO_GRAPHICSEFFECT 228 236 void invalidateDepthRecursively(); … … 230 238 void addChild(QGraphicsItem *child); 231 239 void removeChild(QGraphicsItem *child); 232 void setParentItemHelper(QGraphicsItem *parent); 240 void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant, 241 const QVariant *thisPointerVariant); 233 242 void childrenBoundingRectHelper(QTransform *x, QRectF *rect); 234 243 void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform, … … 350 359 } 351 360 361 inline bool isOpacityNull() const 362 { return (opacity < qreal(0.001)); } 363 364 static inline bool isOpacityNull(qreal opacity) 365 { return (opacity < qreal(0.001)); } 366 352 367 inline bool isFullyTransparent() const 353 368 { 354 if ( opacity < 0.001)369 if (isOpacityNull()) 355 370 return true; 356 371 if (!parent) 357 372 return false; 358 373 359 return calcEffectiveOpacity() < 0.001;374 return isOpacityNull(calcEffectiveOpacity()); 360 375 } 361 376 … … 397 412 return !visible || (childrenCombineOpacity() && isFullyTransparent()); 398 413 } 414 415 inline void markParentDirty(bool updateBoundingRect = false); 399 416 400 417 void setFocusHelper(Qt::FocusReason focusReason, bool climb); … … 485 502 quint32 updateDueToGraphicsEffect : 1; 486 503 quint32 scenePosDescendants : 1; 504 quint32 pendingPolish : 1; 505 quint32 mayHaveChildWithGraphicsEffect : 1; 487 506 488 507 // Optional stacking order … … 610 629 QPoint *offset, 611 630 QGraphicsEffect::PixmapPadMode mode) const; 631 QRect paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded = 0) const; 612 632 613 633 QGraphicsItem *item; … … 721 741 { 722 742 if (needSortChildren) { 723 qSort(children.begin(), children.end(), qt_notclosestLeaf);724 743 needSortChildren = 0; 725 744 sequentialOrdering = 1; 745 if (children.isEmpty()) 746 return; 747 qSort(children.begin(), children.end(), qt_notclosestLeaf); 726 748 for (int i = 0; i < children.size(); ++i) { 727 if (children [i]->d_ptr->siblingIndex != i) {749 if (children.at(i)->d_ptr->siblingIndex != i) { 728 750 sequentialOrdering = 0; 729 751 break; … … 741 763 } 742 764 765 /*! 766 \internal 767 */ 768 inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect) 769 { 770 QGraphicsItemPrivate *parentp = this; 771 while (parentp->parent) { 772 parentp = parentp->parent->d_ptr.data(); 773 parentp->dirtyChildren = 1; 774 775 if (updateBoundingRect) { 776 parentp->dirtyChildrenBoundingRect = 1; 777 // ### Only do this if the parent's effect applies to the entire subtree. 778 parentp->notifyBoundingRectChanged = 1; 779 } 780 #ifndef QT_NO_GRAPHICSEFFECT 781 if (parentp->graphicsEffect) { 782 if (updateBoundingRect) { 783 parentp->notifyInvalidated = 1; 784 static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func() 785 ->source->d_func())->invalidateCache(); 786 } 787 if (parentp->graphicsEffect->isEnabled()) { 788 parentp->dirty = 1; 789 parentp->fullUpdatePending = 1; 790 } 791 } 792 #endif 793 } 794 } 795 743 796 QT_END_NAMESPACE 744 797
Note:
See TracChangeset
for help on using the changeset viewer.