diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-16 11:23:57 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-17 08:21:52 +0200 |
commit | 833a6e18bfeda0e33963b1231c8ed9224332c4b3 (patch) | |
tree | a18fed2bc7520862ef39aa0a1695f70a573135c6 /src/gui/kernel/qevent.h | |
parent | a9982e64eb5108e5c4b51a4e5738c08eff6d07e7 (diff) | |
download | qtbase-833a6e18bfeda0e33963b1231c8ed9224332c4b3.tar.gz |
Implement move and comparison operators for QEventPoint
QEventPoints are equal when all data values are equal, the
refcount is ignored.
Change-Id: I6ef70faf0b12129eaa22bfc1f0a45bab2422d421
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 190959cb16..6abbae07be 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -124,8 +124,14 @@ public: QEventPoint(int id = -1, const QPointingDevice *device = nullptr); QEventPoint(int pointId, State state, const QPointF &scenePosition, const QPointF &globalPosition); QEventPoint(const QEventPoint &other); + QEventPoint(QEventPoint && other) noexcept : d(std::move(other.d)) { other.d = nullptr; } QEventPoint &operator=(const QEventPoint &other); + QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QEventPoint) + bool operator==(const QEventPoint &other) const noexcept; + inline bool operator!=(const QEventPoint &other) const noexcept { return !operator==(other); } ~QEventPoint(); + inline void swap(QEventPoint &other) noexcept + { qSwap(d, other.d); } QPointF position() const; QPointF pressPosition() const; |