summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qset.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qset.h')
-rw-r--r--src/corelib/tools/qset.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index 4b19adc..993ce48 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -85,6 +85,8 @@ public:
inline bool contains(const T &value) const { return q_hash.contains(value); }
+ bool contains(const QSet<T> &set) const;
+
class const_iterator;
class iterator
@@ -274,6 +276,18 @@ Q_INLINE_TEMPLATE QSet<T> &QSet<T>::subtract(const QSet<T> &other)
return *this;
}
+template <class T>
+Q_INLINE_TEMPLATE bool QSet<T>::contains(const QSet<T> &other) const
+{
+ typename QSet<T>::const_iterator i = other.constBegin();
+ while (i != other.constEnd()) {
+ if (!contains(*i))
+ return false;
+ ++i;
+ }
+ return true;
+}
+
template <typename T>
Q_OUTOFLINE_TEMPLATE QList<T> QSet<T>::toList() const
{