From b97070f2c489877b650283842fbbdea708102a40 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 5 Apr 2012 14:49:02 +0200 Subject: QtCore: add member-swap to shared classes Implemented as in other shared classes (e.g. QPen). Special case: QUrlQuery: document existing swap(). Change-Id: I4b36cc9577fbf2232d4b2a2d8822d26e41e22cad Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 7 +++++++ src/corelib/tools/qdatetime.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 1343600369..b76f4e3493 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -2208,6 +2208,13 @@ QDateTime &QDateTime::operator=(const QDateTime &other) d = other.d; return *this; } +/*! + \fn void QDateTime::swap(QDateTime &other) + \since 5.0 + + Swaps this date-time with \a other. This operation is very fast + and never fails. +*/ /*! Returns true if both the date and the time are null; otherwise diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index a648285e89..c38e780dfb 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -210,6 +210,8 @@ public: QDateTime &operator=(const QDateTime &other); + inline void swap(QDateTime &other) { qSwap(d, other.d); } + bool isNull() const; bool isValid() const; -- cgit v1.2.3