diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-09-04 11:35:17 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-09-04 11:35:17 (GMT) |
commit | b576bca55f88ed749a0a2b409be986dbf6b96b0a (patch) | |
tree | 69789d636ff2328cfc4101851f9a28de4a2a825e /src/gui/graphicsview | |
parent | 0b8062f5fbd7622a528ce61b767d00fbcdfc74a0 (diff) | |
parent | 9d85dcf10d580a45c261e3e1a8d8df7d41cb9437 (diff) | |
download | Qt-b576bca55f88ed749a0a2b409be986dbf6b96b0a.zip Qt-b576bca55f88ed749a0a2b409be986dbf6b96b0a.tar.gz Qt-b576bca55f88ed749a0a2b409be986dbf6b96b0a.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.h | 4 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 18 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 15 | ||||
-rw-r--r-- | src/gui/graphicsview/qsimplex_p.h | 4 |
4 files changed, 25 insertions, 16 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index b64f787..098407c 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -170,7 +170,7 @@ struct AnchorData : public QSimplexVariable { skipInPreferred(0), type(Normal), hasSize(false), isLayoutAnchor(false) {} - virtual void updateChildrenSizes() { }; + virtual void updateChildrenSizes() {} virtual void refreshSizeHints(qreal effectiveSpacing); virtual ~AnchorData() {} @@ -299,7 +299,7 @@ struct ParallelAnchorData : public AnchorData class GraphPath { public: - GraphPath() {}; + GraphPath() {} QSimplexConstraint *constraint(const GraphPath &path) const; #ifdef QT_DEBUG diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index b7c2e26..cdcb0c4 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -303,13 +303,17 @@ drop shadow effects and for decoration objects that follow the parent item's geometry without drawing on top of it. - \value ItemUsesExtendedStyleOption The item makes use of either the - exposedRect or matrix member of the QStyleOptionGraphicsItem. Implementers - of QGraphicsItem subclasses should set that flag if this data is required. - By default, the exposedRect is initialized to the item's boundingRect and - the matrix is untransformed. Enable this flag for more fine-grained values. - Use QStyleOptionGraphicsItem::levelOfDetailFromTransform() for a more - fine-grained value. + \value ItemUsesExtendedStyleOption The item makes use of either + \l{QStyleOptionGraphicsItem::}{exposedRect} or + \l{QStyleOptionGraphicsItem::}{matrix} in QStyleOptionGraphicsItem. By default, + the \l{QStyleOptionGraphicsItem::}{exposedRect} is initialized to the item's + boundingRect() and the \l{QStyleOptionGraphicsItem::}{matrix} is untransformed. + You can enable this flag for the style options to be set up with more + fine-grained values. + Note that QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag + and always initialized to 1. Use + QStyleOptionGraphicsItem::levelOfDetailFromTransform() if you need a higher + value. \value ItemHasNoContents The item does not paint anything (i.e., calling paint() on the item has no effect). You should set this flag on items that diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 2ac1dca..5dd71e2 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4616,7 +4616,8 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b return; } - bool hasNoContents = item->d_ptr->flags & QGraphicsItem::ItemHasNoContents; + bool hasNoContents = item->d_ptr->flags & QGraphicsItem::ItemHasNoContents + && !item->d_ptr->graphicsEffect; if (!hasNoContents) { item->d_ptr->dirty = 1; if (fullItemUpdate) @@ -4706,11 +4707,15 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool return; } - const bool itemHasContents = !(item->d_ptr->flags & QGraphicsItem::ItemHasNoContents); + bool itemHasContents = !(item->d_ptr->flags & QGraphicsItem::ItemHasNoContents); const bool itemHasChildren = !item->d_ptr->children.isEmpty(); - if (!itemHasContents && !itemHasChildren) { - resetDirtyItem(item); - return; // Item has neither contents nor children!(?) + if (!itemHasContents) { + if (!itemHasChildren) { + resetDirtyItem(item); + return; // Item has neither contents nor children!(?) + } + if (item->d_ptr->graphicsEffect) + itemHasContents = true; } const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity); diff --git a/src/gui/graphicsview/qsimplex_p.h b/src/gui/graphicsview/qsimplex_p.h index 9ee3863..eac74ac 100644 --- a/src/gui/graphicsview/qsimplex_p.h +++ b/src/gui/graphicsview/qsimplex_p.h @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE struct QSimplexVariable { - QSimplexVariable() : result(0), index(0) {}; + QSimplexVariable() : result(0), index(0) {} qreal result; uint index; @@ -80,7 +80,7 @@ struct QSimplexVariable */ struct QSimplexConstraint { - QSimplexConstraint() : constant(0), ratio(Equal), artificial(0) {}; + QSimplexConstraint() : constant(0), ratio(Equal), artificial(0) {} enum Ratio { LessOrEqual = 0, |