summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsview.cpp
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-03 05:35:06 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-09 07:32:18 (GMT)
commit8af81877bb11d58099189bfab21d21e3021b7b8b (patch)
treeea17960b08a13715fc86d8be91a6fb847d55d0cc /src/gui/graphicsview/qgraphicsview.cpp
parent062b7b1280ef228567d16187951fe43e2ac0f78c (diff)
downloadQt-8af81877bb11d58099189bfab21d21e3021b7b8b.zip
Qt-8af81877bb11d58099189bfab21d21e3021b7b8b.tar.gz
Qt-8af81877bb11d58099189bfab21d21e3021b7b8b.tar.bz2
Add QGraphicsView::isTransformed(), and use it to avoid view transforms.
Ensure that we don't ask for or multiply with the view transform if the view is not transformed.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index e9a432e..c91e0d1 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -3555,6 +3555,18 @@ QTransform QGraphicsView::viewportTransform() const
}
/*!
+ Returns true if the view is transformed (i.e., a non-identity transform
+ has been assigned, or the scrollbars are adjusted).
+
+ \sa setTransform(), horizontalScrollBar(), verticalScrollBar()
+*/
+bool QGraphicsView::isTransformed() const
+{
+ Q_D(const QGraphicsView);
+ return !d->identityMatrix || d->horizontalScroll() || d->verticalScroll();
+}
+
+/*!
Sets the view's current transformation matrix to \a matrix.
If \a combine is true, then \a matrix is combined with the current matrix;