diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qurl.cpp | 8 | ||||
-rw-r--r-- | src/corelib/io/qurl.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qhash.cpp | 1 | ||||
-rw-r--r-- | src/corelib/tools/qmap.cpp | 1 | ||||
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 8 | ||||
-rw-r--r-- | src/corelib/tools/qregexp.h | 1 |
8 files changed, 31 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 6452c0f..6ec5562 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -6048,6 +6048,14 @@ QUrl &QUrl::operator =(const QString &url) return *this; } +/*! + \fn void QUrl::swap(QUrl &other) + \since 4.8 + + Swaps URL \a other with this URL. This operation is very + fast and never fails. +*/ + /*! \internal Forces a detach. diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 563be5f..63fe98d 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -100,6 +100,8 @@ public: #endif ~QUrl(); + inline void swap(QUrl &other) { qSwap(d, other.d); } + void setUrl(const QString &url); void setUrl(const QString &url, ParsingMode mode); // ### Qt 5: merge the two setUrl() functions, with mode = TolerantMode diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index feb85ce..aa070f1 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1808,6 +1808,14 @@ QVariant& QVariant::operator=(const QVariant &variant) } /*! + \fn void QVariant::swap(QVariant &other) + \since 4.8 + + Swaps variant \a other with this variant. This operation is very + fast and never fails. +*/ + +/*! \fn void QVariant::detach() \internal diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index b267954..611db8b 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -224,6 +224,8 @@ class Q_CORE_EXPORT QVariant { qSwap(d, other.d); return *this; } #endif + inline void swap(QVariant &other) { qSwap(d, other.d); } + Type type() const; int userType() const; const char *typeName() const; diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 5a8057d..3dc9c92 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -738,6 +738,7 @@ void QHashData::checkSanity() */ /*! \fn void QMultiHash::swap(QMultiHash<Key, T> &other) + \since 4.8 Swaps hash \a other with this hash. This operation is very fast and never fails. diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index 7b814b3..5a5fffd 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -412,6 +412,7 @@ void QMapData::dump() */ /*! \fn void QMultiMap::swap(QMultiMap<Key, T> &other) + \since 4.8 Swaps map \a other with this map. This operation is very fast and never fails. diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 7a26c4f..5d2a0e3 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -3858,6 +3858,14 @@ QRegExp &QRegExp::operator=(const QRegExp &rx) } /*! + \fn void QRegExp::swap(QRegExp &other) + \since 4.8 + + Swaps regular expression \a other with this regular + expression. This operation is very fast and never fails. +*/ + +/*! Returns true if this regular expression is equal to \a rx; otherwise returns false. diff --git a/src/corelib/tools/qregexp.h b/src/corelib/tools/qregexp.h index 0b4a702..4a74f90 100644 --- a/src/corelib/tools/qregexp.h +++ b/src/corelib/tools/qregexp.h @@ -80,6 +80,7 @@ public: inline QRegExp &operator=(QRegExp &&other) { qSwap(priv,other.priv); return *this; } #endif + inline void swap(QRegExp &other) { qSwap(priv, other.priv); } bool operator==(const QRegExp &rx) const; inline bool operator!=(const QRegExp &rx) const { return !operator==(rx); } |