summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qtransform.h
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-02-03 16:18:20 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-02-28 08:57:57 +0100
commit1ba46c9b632731d7d7e791de2b203d0d933245b9 (patch)
treea7933031bde57f582181c2e9c185989ebdbb9470 /src/gui/painting/qtransform.h
parentd2068b24e4b2e96832af154d02e19b5333880c21 (diff)
Get rid of QMatrix
Task-number: QTBUG-81628 Change-Id: Iad66bfdf49b9ee65558a451108c086fc40dc3884 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/painting/qtransform.h')
-rw-r--r--src/gui/painting/qtransform.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index ac84599f2e..351f2b2e4e 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -40,7 +40,6 @@
#define QTRANSFORM_H
#include <QtGui/qtguiglobal.h>
-#include <QtGui/qmatrix.h>
#include <QtGui/qpainterpath.h>
#include <QtGui/qpolygon.h>
#include <QtGui/qregion.h>
@@ -73,9 +72,6 @@ public:
qreal h31, qreal h32, qreal h33 = 1.0);
QTransform(qreal h11, qreal h12, qreal h21,
qreal h22, qreal dx, qreal dy);
-#if QT_DEPRECATED_SINCE(5, 15)
- explicit QTransform(const QMatrix &mtx);
-#endif // QT_DEPRECATED_SINCE(5, 15)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// ### Qt 6: remove; the compiler-generated ones are fine!
@@ -160,10 +156,6 @@ public:
void map(int x, int y, int *tx, int *ty) const;
void map(qreal x, qreal y, qreal *tx, qreal *ty) const;
-#if QT_DEPRECATED_SINCE(5, 15)
- QMatrix toAffine() const;
-#endif // QT_DEPRECATED_SINCE(5, 15)
-
QTransform &operator*=(qreal div);
QTransform &operator/=(qreal div);
QTransform &operator+=(qreal div);
@@ -173,6 +165,16 @@ public:
static QTransform fromScale(qreal dx, qreal dy);
private:
+ struct Affine {
+ qreal (& m_matrix)[3][3];
+ };
+
+public:
+ auto asAffineMatrix() { return Affine { m_matrix }; }
+ friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &s, Affine &m);
+ friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &s, const Affine &m);
+
+private:
inline QTransform(qreal h11, qreal h12, qreal h13,
qreal h21, qreal h22, qreal h23,
qreal h31, qreal h32, qreal h33, bool)