diff options
author | axis <qt-info@nokia.com> | 2009-12-16 08:37:34 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-12-16 08:37:34 (GMT) |
commit | 6e527912d719b0448b91eba1d6a99b9cbe58170a (patch) | |
tree | 17ba94b2af34ba2ab953fbd7be84955bdea39370 /src/gui/graphicsview/qgraphicsview.cpp | |
parent | 8152bd167c1a728c54a9976297bb53e09d131d66 (diff) | |
parent | a9d4faa330698a7972c7fa4b3582fb20548b32f6 (diff) | |
download | Qt-6e527912d719b0448b91eba1d6a99b9cbe58170a.zip Qt-6e527912d719b0448b91eba1d6a99b9cbe58170a.tar.gz Qt-6e527912d719b0448b91eba1d6a99b9cbe58170a.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6-s60
Conflicts:
src/s60installs/bwins/QtGuiu.def
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 3f9f443..ffe64aa 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -545,6 +545,32 @@ qint64 QGraphicsViewPrivate::verticalScroll() const /*! \internal + + Maps the given rectangle to the scene using QTransform::mapRect() +*/ +QRectF QGraphicsViewPrivate::mapRectToScene(const QRect &rect) const +{ + if (dirtyScroll) + const_cast<QGraphicsViewPrivate *>(this)->updateScroll(); + QRectF scrolled = QRectF(rect.translated(scrollX, scrollY)); + return identityMatrix ? scrolled : matrix.inverted().mapRect(scrolled); +} + + +/*! + \internal + + Maps the given rectangle from the scene using QTransform::mapRect() +*/ +QRectF QGraphicsViewPrivate::mapRectFromScene(const QRectF &rect) const +{ + if (dirtyScroll) + const_cast<QGraphicsViewPrivate *>(this)->updateScroll(); + return (identityMatrix ? rect : matrix.mapRect(rect)).translated(-scrollX, -scrollY); +} + +/*! + \internal */ void QGraphicsViewPrivate::updateScroll() { |