QItemSelectionRange: add nothrow member-swap

Change-Id: Ie550f4a66b3c623b0ec630c18f38bcd96f6bbc99
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2015-07-20 01:26:03 +02:00
parent f8441c071f
commit 02affdb891
2 changed files with 14 additions and 0 deletions

View File

@ -103,6 +103,14 @@ QT_BEGIN_NAMESPACE
by the model index \a index.
*/
/*!
\fn QItemSelectionRange::swap(QItemSelectionRange &other)
\since 5.6
Swaps this selection range's contents with \a other.
This function is very fast and never fails.
*/
/*!
\fn int QItemSelectionRange::top() const

View File

@ -55,6 +55,12 @@ public:
explicit inline QItemSelectionRange(const QModelIndex &index)
{ tl = index; br = tl; }
void swap(QItemSelectionRange &other) Q_DECL_NOTHROW
{
qSwap(tl, other.tl);
qSwap(br, other.br);
}
inline int top() const { return tl.row(); }
inline int left() const { return tl.column(); }
inline int bottom() const { return br.row(); }