QCursor: add move ctor
QCursor already dealt with d == nullptr, so this is trivial. Change-Id: Ib2c6a3f0dc8b93035ffe3059cdce925463706e10 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>bb10
parent
cd82be5c17
commit
6ac7e2f710
|
|
@ -148,6 +148,16 @@ QT_BEGIN_NAMESPACE
|
|||
\sa QWidget, {fowler}{GUI Design Handbook: Cursors}
|
||||
*/
|
||||
|
||||
/*!
|
||||
\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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue