diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-04-03 12:43:11 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-15 10:17:59 (GMT) |
commit | ac256e5eac02ec44557b6e90ad183a51c772bf33 (patch) | |
tree | 92b49e9adeb2535825f4702e892d01c6b0b1e3a4 | |
parent | 34edfc49ab0dac256bb536ce41a381741ca82236 (diff) | |
download | Qt-ac256e5eac02ec44557b6e90ad183a51c772bf33.zip Qt-ac256e5eac02ec44557b6e90ad183a51c772bf33.tar.gz Qt-ac256e5eac02ec44557b6e90ad183a51c772bf33.tar.bz2 |
Add a cut-off for simple rectangle lookups.
Make sure we use the rect-variation of QGraphicsScene's item lookup
functions if the view has a simple transform and a simple expose
region.
Reviewed-by: Bjoern Erik Nilsen <bjorn.nilsen@nokia.com>
(cherry picked from commit 4020327503eaefae42da4bd6e71125b6972ac97f)
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 819b75a..f5170a4 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1056,6 +1056,11 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg } if (scene->d_func()->largestUntransformableItem.isNull()) { + if (exposedRegion.numRects() == 1 && matrix.type() <= QTransform::TxScale) { + return scene->d_func()->items_helper(exposedScenePath.controlPointRect(), + Qt::IntersectsItemBoundingRect, + Qt::DescendingOrder); + } return scene->d_func()->items_helper(exposedScenePath, Qt::IntersectsItemBoundingRect, Qt::DescendingOrder); |