45 #include <QtCore/qhash.h> 64 #ifdef Q_COMPILER_RVALUE_REFS 89 inline bool remove(
const T &value) {
return q_hash.
remove(value) != 0; }
173 {
return q_hash.
erase(reinterpret_cast<typename Hash::iterator &>(i)); }
212 {
QSet<T> result = *
this; result |= other;
return result; }
214 {
QSet<T> result = *
this; result &= other;
return result; }
216 {
QSet<T> result = *
this; result += other;
return result; }
218 {
QSet<T> result = *
this; result -= other;
return result; }
219 #if QT_VERSION < 0x050000 222 {
QSet<T> result = *
this; result |= other;
return result; }
224 {
QSet<T> result = *
this; result &= other;
return result; }
226 {
QSet<T> result = *
this; result += other;
return result; }
228 {
QSet<T> result = *
this; result -= other;
return result; }
295 template <
typename T>
308 template <
typename T>
313 for (
int i = 0;
i <
size(); ++
i)
318 template <
typename T>
324 template <
typename T>
332 template <
typename T>
348 i = c->
begin(); n = c->
end();
return *
this; }
352 inline const T &
next() { n = i++;
return *n; }
361 {
while (c->
constEnd() != (n =
i))
if (*i++ == t)
return true;
return false; }
363 {
while (c->
constBegin() !=
i)
if (*(n = --i) == t)
return true;
364 n = c->
end();
return false; }
QSet< T > & operator|=(const QSet< T > &other)
bool operator!=(const QSet< T > &other) const
iterator & operator=(const iterator &o)
void setSharable(bool sharable)
QSet< T > & unite(const QSet< T > &other)
QHash< T, QHashDummyValue > Hash
bool isDetached() const
Returns true if the hash's internal data isn't shared with any other hash object; otherwise returns f...
#define QT_END_NAMESPACE
This macro expands to.
QSet< T > toSet() const
Returns a QSet object with the data contained in this QList.
void clear()
Removes all items from the hash.
const_iterator & operator+=(int j)
const_iterator & operator--()
int remove(const Key &key)
Removes all the items that have the key from the hash.
const_iterator & operator++()
iterator operator-(int j) const
QSet< T > operator-(const QSet< T > &other)
const_iterator(const iterator &o)
QSet< T > & operator<<(const T &value)
#define at(className, varName)
const_iterator constEnd() const
QSet< T > & operator|=(const T &value)
bool operator==(const QSet< T > &other) const
QSet< T > operator|(const QSet< T > &other)
QSet(const QSet< T > &other)
void squeeze()
Reduces the size of the QHash's internal hash table to save memory.
iterator(const iterator &o)
const_iterator find(const T &value) const
QSet< T > & operator &=(const QSet< T > &other)
void swap(QHash< Key, T > &other)
Swaps hash other with this hash.
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
QSet< T >::iterator iterator
void reserve(int size)
Ensures that the QHash's internal hash table consists of at least size buckets.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
const_iterator & operator-=(int j)
const T & operator*() const
bool findNext(const T &t)
QSet< T > & operator=(const QSet< T > &other)
void append(const T &t)
Inserts value at the end of the list.
iterator & operator-=(int j)
#define QT_BEGIN_NAMESPACE
This macro expands to.
#define Q_DECLARE_SEQUENTIAL_ITERATOR(C)
QSet< T > & intersect(const QSet< T > &other)
QSet< T > & operator+=(const QSet< T > &other)
friend class const_iterator
const_iterator operator-(int j) const
const_iterator begin() const
const T & peekPrevious() const
QIntegerForSizeof< void * >::Signed qptrdiff
bool contains(const T &value) const
QList< T > toList() const
QSet< T > operator &(const QSet< T > &other) const
const_iterator constFind(const T &value) const
bool operator!=(const const_iterator &o) const
QSet< T > operator &(const QSet< T > &other)
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
const_iterator ConstIterator
const_iterator insert(const T &value)
const_iterator operator++(int)
#define Q_INLINE_TEMPLATE
bool operator!=(const const_iterator &o) const
std::bidirectional_iterator_tag iterator_category
const value_type * const_pointer
void setSharable(bool sharable)
QSet< T > & subtract(const QSet< T > &other)
static QList< T > fromSet(const QSet< T > &set)
Returns a QList object with the data contained in set.
void qSwap(T &value1, T &value2)
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
const_iterator(typename Hash::const_iterator o)
QHash< T, QHashDummyValue > Hash
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
QSet< T > operator+(const QSet< T > &other)
bool findPrevious(const T &t)
bool operator==(const iterator &o) const
int size() const
Returns the number of items in the hash.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
QSet< T > operator-(const QSet< T > &other) const
const value_type & const_reference
void swap(QSet< T > &other)
const T * operator->() const
void detach()
Detaches this hash from any other hashes with which it may share data.
iterator & operator+=(int j)
const T & peekNext() const
const_iterator & operator=(const const_iterator &o)
QMutableSetIterator(QSet< T > &container)
bool operator!=(const iterator &o) const
const_iterator operator+(int j) const
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
const_iterator constBegin() const
QSet< T > & operator-=(const T &value)
const_iterator operator--(int)
bool operator==(const const_iterator &o) const
QHash< T, QHashDummyValue > Hash
QSet< T > & operator-=(const QSet< T > &other)
int count(const Key &key) const
Returns the number of items associated with the key.
const_iterator end() const
int capacity() const
Returns the number of buckets in the QHash's internal hash table.
bool operator==(const const_iterator &o) const
const_iterator(const const_iterator &o)
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
QList< T > values() const
QMutableSetIterator & operator=(QSet< T > &container)
static QSet< T > fromList(const QList< T > &list)
#define Q_OUTOFLINE_TEMPLATE
iterator erase(iterator i)
std::bidirectional_iterator_tag iterator_category
const T * operator->() const
const T & operator*() const
QSet< T > operator+(const QSet< T > &other) const
iterator erase(iterator it)
Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator...
iterator operator+(int j) const
iterator(typename Hash::iterator o)
iterator find(const T &value)
friend class const_iterator
QSet< T > & operator &=(const T &value)
void reserve(int size)
Reserve space for alloc elements.
QSet< T > & operator+=(const T &value)
The QList class is a template class that provides lists.
QSet< T > operator|(const QSet< T > &other) const