summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qtransform.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/qtransform.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/qtransform.h')
-rw-r--r--src/gui/painting/qtransform.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index 8e97d1eb6f..470a5565e1 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -74,6 +74,19 @@ public:
qreal h22, qreal dx, qreal dy);
explicit QTransform(const QMatrix &mtx);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ // ### Qt 6: remove; the compiler-generated ones are fine!
+ QTransform &operator=(QTransform &&other) Q_DECL_NOTHROW // = default
+ { memcpy(this, &other, sizeof(QTransform)); return *this; }
+ QTransform &operator=(const QTransform &) Q_DECL_NOTHROW; // = default
+ QTransform(QTransform &&other) Q_DECL_NOTHROW // = default
+ : affine(Qt::Uninitialized)
+ { memcpy(this, &other, sizeof(QTransform)); }
+ QTransform(const QTransform &other) Q_DECL_NOTHROW // = default
+ : affine(Qt::Uninitialized)
+ { memcpy(this, &other, sizeof(QTransform)); }
+#endif
+
bool isAffine() const;
bool isIdentity() const;
bool isInvertible() const;
@@ -124,8 +137,6 @@ public:
QTransform &operator*=(const QTransform &);
QTransform operator*(const QTransform &o) const;
- QTransform &operator=(const QTransform &);
-
operator QVariant() const;
void reset();
@@ -180,9 +191,10 @@ private:
mutable uint m_type : 5;
mutable uint m_dirty : 5;
-
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
class Private;
Private *d;
+#endif
};
Q_DECLARE_TYPEINFO(QTransform, Q_MOVABLE_TYPE);