summaryrefslogtreecommitdiffstats
path: root/src/corelib/itemmodels
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp7
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index c94b3cb540..c78287759b 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -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
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index 976c1600c6..df39c33611 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -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);