Add a new optimization flag to QGraphicsItem.
authorDimitar Asenov <dimitar.asenov@gmail.com>
Wed, 12 Mar 2014 21:11:45 +0000 (14:11 -0700)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 31 Mar 2014 20:54:14 +0000 (22:54 +0200)
commit3270b4490bc420359483cb00ae48e91e261b30e8
treed6e18a39fd0d21d36d10abe6edbfdb68084780ca
parentd13d03f012b9c0516fa027f4e1ea18c12f1491ca
Add a new optimization flag to QGraphicsItem.

The new flag ItemContainsChildrenInShape is similar to the existing
flag ItemClipsChildrenToShape. Setting the new flag makes QGraphicsScene
assume that children are drawn within the shape of the current item
but this is not enforced by clipping. When an application manually
ensures this clipping boundary, setting the new flag removes the
overhead of enforcing the clip with ItemClipsChildrenToShape, while
still allowing other routines to behave more optimially by assuming
children are within the shape of the current item.

[ChangeLog][QtWidgets][QGraphicsItem] Added the
ItemContainsChildrenInShape flag that enables using optimizations
of ItemClipsChildrenToShape without the overhead of enforcing the clip.

Change-Id: I5496fe1ca331b77fd51e0df8a3ace2b8e939eaf2
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
src/widgets/graphicsview/qgraphicsitem.cpp
src/widgets/graphicsview/qgraphicsitem.h
src/widgets/graphicsview/qgraphicsitem_p.h
src/widgets/graphicsview/qgraphicsscene.cpp
src/widgets/graphicsview/qgraphicsscenebsptreeindex.cpp
src/widgets/graphicsview/qgraphicssceneindex.cpp
tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp