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 <thiago.macieira@intel.com>
This commit is contained in:
parent
02aee5d174
commit
b97070f2c4
@ -124,6 +124,14 @@
|
||||
Flushes any pending data to be written and destroys the debug stream.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QDebug::swap(QDebug &other)
|
||||
\since 5.0
|
||||
|
||||
Swaps this debug stream instance with \a other. This function is
|
||||
very fast and never fails.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QDebug &QDebug::space()
|
||||
|
||||
|
@ -91,6 +91,8 @@ public:
|
||||
delete stream;
|
||||
}
|
||||
}
|
||||
inline void swap(QDebug &other) { qSwap(stream, other.stream); }
|
||||
|
||||
inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; }
|
||||
inline QDebug &nospace() { stream->space = false; return *this; }
|
||||
inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; }
|
||||
|
@ -1710,6 +1710,14 @@ QDir &QDir::operator=(const QString &path)
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn void QDir::swap(QDir &other)
|
||||
\since 5.0
|
||||
|
||||
Swaps this QDir instance with \a other. This function is very fast
|
||||
and never fails.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool QDir::operator!=(const QDir &dir) const
|
||||
|
||||
|
@ -115,6 +115,9 @@ public:
|
||||
{ qSwap(d_ptr, other.d_ptr); return *this; }
|
||||
#endif
|
||||
|
||||
inline void swap(QDir &other)
|
||||
{ qSwap(d_ptr, other.d_ptr); }
|
||||
|
||||
void setPath(const QString &path);
|
||||
QString path() const;
|
||||
QString absolutePath() const;
|
||||
|
@ -429,6 +429,14 @@ QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo)
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn void QFileInfo::swap(QFileInfo &other)
|
||||
\since 5.0
|
||||
|
||||
Swaps this file info with \a other. This function is very fast and
|
||||
never fails.
|
||||
*/
|
||||
|
||||
/*!
|
||||
Sets the file that the QFileInfo provides information about to \a
|
||||
file.
|
||||
|
@ -74,6 +74,10 @@ public:
|
||||
inline QFileInfo&operator=(QFileInfo &&other)
|
||||
{ qSwap(d_ptr, other.d_ptr); return *this; }
|
||||
#endif
|
||||
|
||||
inline void swap(QFileInfo &other)
|
||||
{ qSwap(d_ptr, other.d_ptr); }
|
||||
|
||||
bool operator==(const QFileInfo &fileinfo) const;
|
||||
inline bool operator!=(const QFileInfo &fileinfo) const { return !(operator==(fileinfo)); }
|
||||
|
||||
|
@ -236,6 +236,14 @@ QProcessEnvironment &QProcessEnvironment::operator=(const QProcessEnvironment &o
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn void QProcessEnvironment::swap(QProcessEnvironment &other)
|
||||
\since 5.0
|
||||
|
||||
Swaps this process environment instance with \a other. This
|
||||
function is very fast and never fails.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool QProcessEnvironment::operator !=(const QProcessEnvironment &other) const
|
||||
|
||||
|
@ -72,6 +72,8 @@ public:
|
||||
~QProcessEnvironment();
|
||||
QProcessEnvironment &operator=(const QProcessEnvironment &other);
|
||||
|
||||
inline void swap(QProcessEnvironment &other) { qSwap(d, other.d); }
|
||||
|
||||
bool operator==(const QProcessEnvironment &other) const;
|
||||
inline bool operator!=(const QProcessEnvironment &other) const
|
||||
{ return !(*this == other); }
|
||||
|
@ -358,6 +358,13 @@ QUrlQuery &QUrlQuery::operator =(const QUrlQuery &other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
\fn void QUrlQuery::swap(QUrlQuery &other)
|
||||
|
||||
Swaps this URL query instance with \a other. This function is very
|
||||
fast and never fails.
|
||||
*/
|
||||
|
||||
/*!
|
||||
Destroys this QUrlQuery object.
|
||||
*/
|
||||
|
@ -213,6 +213,13 @@ QPersistentModelIndex &QPersistentModelIndex::operator=(const QPersistentModelIn
|
||||
if (d) d->ref.ref();
|
||||
return *this;
|
||||
}
|
||||
/*!
|
||||
\fn void QPersistentModelIndex::swap(QPersistentModelIndex &other)
|
||||
\since 5.0
|
||||
|
||||
Swaps this persistent modelindex with \a other. This function is
|
||||
very fast and never fails.
|
||||
*/
|
||||
|
||||
/*!
|
||||
Sets the persistent model index to refer to the same item in a model
|
||||
|
@ -116,6 +116,7 @@ public:
|
||||
inline bool operator!=(const QPersistentModelIndex &other) const
|
||||
{ return !operator==(other); }
|
||||
QPersistentModelIndex &operator=(const QPersistentModelIndex &other);
|
||||
inline void swap(QPersistentModelIndex &other) { qSwap(d, other.d); }
|
||||
bool operator==(const QModelIndex &other) const;
|
||||
bool operator!=(const QModelIndex &other) const;
|
||||
QPersistentModelIndex &operator=(const QModelIndex &other);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user