From 9891c5051f02b940f6dc94ac4ccf945e036feb13 Mon Sep 17 00:00:00 2001 From: Dimitar Asenov Date: Wed, 12 Mar 2014 14:19:04 -0700 Subject: Add a new optimization property to QGraphicsScene The minimumRenderSize is a qreal value that is used as a lower bound to determine what items are visible when a scene is rendered. If an item's view-transformed width or height are less than minimumRenderSize then this item is considered to insignificantly affect the final result and is not drawn. If the item clips its children to its shape they are automatically not drawn. This greatly reduces the drawing overhead for scenes with many items rendered in a zoomed out view. [ChangeLog][QtWidgets][QGraphicsScene] Added the minimumRenderSize property which can be used to speed up rendering by not painting items, smaller than a give size. Change-Id: Ie208234707dffb4d2fc620fc5d1514e0c144d9a8 Reviewed-by: Andreas Aardal Hanssen --- src/widgets/styles/qstyleoption.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/styles/qstyleoption.cpp') diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 5913b2f261..f642a05d13 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -3702,6 +3702,8 @@ QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(int version) of the painter used to draw the item. By default, if no transformations are applied, its value is 1. If zoomed out 1:2, the level of detail will be 0.5, and if zoomed in 2:1, its value is 2. + + \sa QGraphicsScene::minimumRenderSize() */ qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &worldTransform) { -- cgit v1.2.3