summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-07-20 01:26:03 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-07-22 21:12:25 +0000
commit02affdb8913c9b2633d918000e0b23bf5e3cf3ec (patch)
treeebd03ce2d8fcf48e055fdd234ed177ea4f1a470d /src/corelib/itemmodels
parentf8441c071fe52a4703692bdb334c019d3bdaa859 (diff)
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>
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp8
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h6
2 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index 65b76ca6a0..fa7d4647a4 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -104,6 +104,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \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
Returns the row index corresponding to the uppermost selected row in the
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index c5caa1c69e..e548a49b3d 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -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(); }