summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-01-04 22:59:49 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-01-05 13:03:20 +0100
commit6ac7e2f710fdbea19f2416b1b26517f533398893 (patch)
tree1453183d40469e9f79ea91cd9e849d01ec58bc7c /src/gui
parentcd82be5c1723a1ce29b7794ff87594020d7b7a48 (diff)
QCursor: add move ctor
QCursor already dealt with d == nullptr, so this is trivial. Change-Id: Ib2c6a3f0dc8b93035ffe3059cdce925463706e10 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qcursor.cpp10
-rw-r--r--src/gui/kernel/qcursor.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index 235d2b3053..9c5bce7750 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -149,6 +149,16 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn QCursor::QCursor(QCursor &&other)
+ \since 5.5
+
+ Move-constructs a cursor from \a other. After being moved from,
+ the only valid operations on \a other are destruction and
+ (move and copy) assignment. The effects of calling any other
+ member function on a moved-from instance are undefined.
+*/
+
+/*!
\fn QCursor &QCursor::operator=(QCursor &&other)
Move-assigns \a other to this QCursor instance.
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h
index 72c6a6504f..3c0e8ecf30 100644
--- a/src/gui/kernel/qcursor.h
+++ b/src/gui/kernel/qcursor.h
@@ -80,6 +80,7 @@ public:
~QCursor();
QCursor &operator=(const QCursor &cursor);
#ifdef Q_COMPILER_RVALUE_REFS
+ QCursor(QCursor &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; }
inline QCursor &operator=(QCursor &&other)
{ qSwap(d, other.d); return *this; }
#endif