summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qmatrix.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-02-10 15:43:15 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-02-11 19:26:05 +0000
commit4bc923b6281dcbdc610133f1c47523999ef8c153 (patch)
treedbdfc34e6a79d3824d094c62a29544b725b2b952 /src/gui/painting/qmatrix.h
parentd55b685d237be7a6bd01b52600bcc9ffcee4e2a5 (diff)
QMatrix, QTransform: restore nothrow move special members
The user-defined copy assignment and (on QMatrix) copy constructors inhibit the move special member functions. We cannot do something about it in Qt 5, because these classes are exported (which they shouldn't be), and because making them trivially copyable might change how they are passed to functions by value, so we need to supply all the missing member functions manually. Change-Id: I59e480d7ba02cac7e3d654cb3345f541e0701f4c Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/gui/painting/qmatrix.h')
-rw-r--r--src/gui/painting/qmatrix.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index 342898b561..b28c8433cd 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -60,7 +60,16 @@ public:
QMatrix();
QMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
qreal dx, qreal dy);
- QMatrix(const QMatrix &matrix);
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ // ### Qt 6: remove; the compiler-generated ones are fine!
+ QMatrix &operator=(QMatrix &&other) Q_DECL_NOTHROW // = default
+ { memcpy(this, &other, sizeof(QMatrix)); return *this; }
+ QMatrix &operator=(const QMatrix &) Q_DECL_NOTHROW; // = default
+ QMatrix(QMatrix &&other) Q_DECL_NOTHROW // = default
+ { memcpy(this, &other, sizeof(QMatrix)); }
+ QMatrix(const QMatrix &other) Q_DECL_NOTHROW; // = default
+#endif
void setMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
qreal dx, qreal dy);
@@ -106,8 +115,6 @@ public:
QMatrix &operator*=(const QMatrix &);
QMatrix operator*(const QMatrix &o) const;
- QMatrix &operator=(const QMatrix &);
-
operator QVariant() const;
private: