summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicstransform.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-08-19 23:06:18 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-08-19 23:06:18 (GMT)
commit6858ce448718db1cc7c76535cac82672ad1d7664 (patch)
treeaaf5f9dbf0131cca2f0fc6a50c8fb32a666d777f /src/gui/graphicsview/qgraphicstransform.cpp
parentfeabd6584880c775a516d157c9cd24f0e707060d (diff)
downloadQt-6858ce448718db1cc7c76535cac82672ad1d7664.zip
Qt-6858ce448718db1cc7c76535cac82672ad1d7664.tar.gz
Qt-6858ce448718db1cc7c76535cac82672ad1d7664.tar.bz2
Remove QGraphicsTransform::project()
QMatrix4x4::toTransform() now does what project() used to do. Reviewed-by: trustme
Diffstat (limited to 'src/gui/graphicsview/qgraphicstransform.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicstransform.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp
index b486438..585e0f9 100644
--- a/src/gui/graphicsview/qgraphicstransform.cpp
+++ b/src/gui/graphicsview/qgraphicstransform.cpp
@@ -149,38 +149,9 @@ QGraphicsTransform::QGraphicsTransform(QGraphicsTransformPrivate &p, QObject *pa
It applies this transformation to \a matrix.
- \sa QGraphicsItem::transform(), project()
+ \sa QGraphicsItem::transform(), QMatrix4x4::toTransform()
*/
-static const qreal inv_dist_to_plane = 1. / 1024.;
-
-/*!
- Projects \a matrix into a 2D transformation that has the same
- effect as applying \a matrix and then projecting the co-ordinates
- to two dimensions.
-
- \sa applyTo()
-*/
-QTransform QGraphicsTransform::project(const QMatrix4x4& matrix)
-{
- // The following projection matrix is pre-multiplied with "matrix":
- // | 1 0 0 0 |
- // | 0 1 0 0 |
- // | 0 0 1 0 |
- // | 0 0 d 1 |
- // where d = -1 / 1024. This projection is consistent with the
- // Qt::XAxis and Qt::YAxis rotations of QTransform::rotate().
- // After projection, row 3 and column 3 are dropped to form
- // the final QTransform.
- return QTransform
- (matrix(0, 0), matrix(1, 0),
- matrix(3, 0) - matrix(2, 0) * inv_dist_to_plane,
- matrix(0, 1), matrix(1, 1),
- matrix(3, 1) - matrix(2, 1) * inv_dist_to_plane,
- matrix(0, 3), matrix(1, 3),
- matrix(3, 3) - matrix(2, 3) * inv_dist_to_plane);
-}
-
/*!
Notifies that this transform operation has changed its parameters in such a
way that applyTo() will return a different result than before.