#[repr(C)]
pub struct QSetOfQAbstractState { /* private fields */ }
Expand description

The QSet class is a template class that provides a hash-table-based set.

C++ class: QSet<QAbstractState*>.

C++ documentation:

The QSet class is a template class that provides a hash-table-based set.

QSet<T> is one of Qt's generic container classes. It stores values in an unspecified order and provides very fast lookup of the values. Internally, QSet<T> is implemented as a QHash.

Here's an example QSet with QString values:

QSet<QString> set;

To insert a value into the set, use insert():

set.insert(“one”); set.insert(“three”); set.insert(“seven”);

Another way to insert items into the set is to use operator<<():

set << “twelve” << “fifteen” << “nineteen”;

To test whether an item belongs to the set or not, use contains():

if (!set.contains(“ninety-nine”)) ...

If you want to navigate through all the values stored in a QSet, you can use an iterator. QSet supports both Java-style iterators (QSetIterator and QMutableSetIterator) and STL-style iterators (QSet::iterator and QSet::const_iterator). Here's how to iterate over a QSet<QWidget *> using a Java-style iterator:

QSetIterator<QWidget *> i(set); while (i.hasNext()) qDebug() << i.next();

Here's the same code, but using an STL-style iterator:

QSet<QWidget >::const_iterator i = set.constBegin(); while (i != set.constEnd()) { qDebug() << i; ++i; }

QSet is unordered, so an iterator's sequence cannot be assumed to be predictable. If ordering by key is required, use a QMap.

To navigate through a QSet, you can also use foreach:

QSet<QString> set; ... foreach (const QString &value, set) qDebug() << value;

Items can be removed from the set using remove(). There is also a clear() function that removes all items.

QSet's value data type must be an assignable data type. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. In addition, the type must provide operator==(), and there must also be a global qHash() function that returns a hash value for an argument of the key's type. See the QHash documentation for a list of types supported by qHash().

Internally, QSet uses a hash table to perform lookups. The hash table automatically grows and shrinks to provide fast lookups without wasting memory. You can still control the size of the hash table by calling reserve(), if you already know approximately how many elements the QSet will contain, but this isn't necessary to obtain good performance. You can also call capacity() to retrieve the hash table's size.

Implementations§

source§

impl QSetOfQAbstractState

source

pub unsafe fn add_assign_q_set_of_q_abstract_state( &self, other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> Ref<QSetOfQAbstractState>

Same as unite(other).

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator+=(const QSet<QAbstractState*>& other).

C++ documentation:

Same as unite(other).

See also operator|(), operator&=(), and operator-=().

source

pub unsafe fn add_assign_q_abstract_state( &self, value: *const *mut QAbstractState ) -> Ref<QSetOfQAbstractState>

Inserts a new item value and returns a reference to the set. If value already exists in the set, the set is left unchanged.

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator+=(const QAbstractState*& value).

C++ documentation:

Inserts a new item value and returns a reference to the set. If value already exists in the set, the set is left unchanged.

See also insert().

source

pub unsafe fn begin_mut(&self) -> CppBox<Iterator>

This is an overloaded function.

Calls C++ function: QSet<QAbstractState*>::iterator QSet<QAbstractState*>::begin().

C++ documentation:

This is an overloaded function.

Returns a non-const STL-style iterator positioned at the first item in the set.

This function was introduced in Qt 4.2.

source

pub unsafe fn begin(&self) -> CppBox<ConstIterator>

Returns a const STL-style iterator positioned at the first item in the set.

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::begin() const.

C++ documentation:

Returns a const STL-style iterator positioned at the first item in the set.

See also constBegin() and end().

source

pub unsafe fn bit_and_assign_q_set_of_q_abstract_state( &self, other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> Ref<QSetOfQAbstractState>

Same as intersect(other).

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator&=(const QSet<QAbstractState*>& other).

C++ documentation:

Same as intersect(other).

See also operator&(), operator|=(), and operator-=().

source

pub unsafe fn bit_and_assign_q_abstract_state( &self, value: *const *mut QAbstractState ) -> Ref<QSetOfQAbstractState>

This is an overloaded function.

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator&=(const QAbstractState*& value).

C++ documentation:

This is an overloaded function.

Same as intersect(other), if we consider other to be a set that contains the singleton value.

source

pub unsafe fn bit_or_assign_q_set_of_q_abstract_state( &self, other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> Ref<QSetOfQAbstractState>

Same as unite(other).

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator|=(const QSet<QAbstractState*>& other).

C++ documentation:

Same as unite(other).

See also operator|(), operator&=(), and operator-=().

source

pub unsafe fn bit_or_assign_q_abstract_state( &self, value: *const *mut QAbstractState ) -> Ref<QSetOfQAbstractState>

Inserts a new item value and returns a reference to the set. If value already exists in the set, the set is left unchanged.

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator|=(const QAbstractState*& value).

C++ documentation:

Inserts a new item value and returns a reference to the set. If value already exists in the set, the set is left unchanged.

See also insert().

source

pub unsafe fn capacity(&self) -> c_int

Returns the number of buckets in the set's internal hash table.

Calls C++ function: int QSet<QAbstractState*>::capacity() const.

C++ documentation:

Returns the number of buckets in the set’s internal hash table.

The sole purpose of this function is to provide a means of fine tuning QSet's memory usage. In general, you will rarely ever need to call this function. If you want to know how many items are in the set, call size().

See also reserve() and squeeze().

source

pub unsafe fn cbegin(&self) -> CppBox<ConstIterator>

Returns a const STL-style iterator positioned at the first item in the set.

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::cbegin() const.

C++ documentation:

Returns a const STL-style iterator positioned at the first item in the set.

This function was introduced in Qt 5.0.

See also begin() and cend().

source

pub unsafe fn cend(&self) -> CppBox<ConstIterator>

Returns a const STL-style iterator pointing to the imaginary item after the last item in the set.

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::cend() const.

C++ documentation:

Returns a const STL-style iterator pointing to the imaginary item after the last item in the set.

This function was introduced in Qt 5.0.

See also cbegin() and end().

source

pub unsafe fn clear(&self)

Removes all elements from the set.

Calls C++ function: void QSet<QAbstractState*>::clear().

C++ documentation:

Removes all elements from the set.

See also remove().

source

pub unsafe fn const_begin(&self) -> CppBox<ConstIterator>

Returns a const STL-style iterator positioned at the first item in the set.

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::constBegin() const.

C++ documentation:

Returns a const STL-style iterator positioned at the first item in the set.

See also begin() and constEnd().

source

pub unsafe fn const_end(&self) -> CppBox<ConstIterator>

Returns a const STL-style iterator pointing to the imaginary item after the last item in the set.

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::constEnd() const.

C++ documentation:

Returns a const STL-style iterator pointing to the imaginary item after the last item in the set.

See also constBegin() and end().

source

pub unsafe fn const_find( &self, value: *const *mut QAbstractState ) -> CppBox<ConstIterator>

Returns a const iterator positioned at the item value in the set. If the set contains no item value, the function returns constEnd().

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::constFind(const QAbstractState*& value) const.

C++ documentation:

Returns a const iterator positioned at the item value in the set. If the set contains no item value, the function returns constEnd().

This function was introduced in Qt 4.2.

See also find() and contains().

source

pub unsafe fn contains_q_abstract_state( &self, value: *const *mut QAbstractState ) -> bool

Returns true if the set contains item value; otherwise returns false.

Calls C++ function: bool QSet<QAbstractState*>::contains(const QAbstractState*& value) const.

C++ documentation:

Returns true if the set contains item value; otherwise returns false.

See also insert(), remove(), and find().

source

pub unsafe fn contains_q_set_of_q_abstract_state( &self, set: impl CastInto<Ref<QSetOfQAbstractState>> ) -> bool

Returns true if the set contains all items from the other set; otherwise returns false.

Calls C++ function: bool QSet<QAbstractState*>::contains(const QSet<QAbstractState*>& set) const.

C++ documentation:

Returns true if the set contains all items from the other set; otherwise returns false.

This function was introduced in Qt 4.6.

See also insert(), remove(), and find().

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> Ref<QSetOfQAbstractState>

The QSet class is a template class that provides a hash-table-based set.

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator=(const QSet<QAbstractState*>& other).

C++ documentation:

The QSet class is a template class that provides a hash-table-based set.

QSet<T> is one of Qt's generic container classes. It stores values in an unspecified order and provides very fast lookup of the values. Internally, QSet<T> is implemented as a QHash.

Here's an example QSet with QString values:

QSet<QString> set;

To insert a value into the set, use insert():

set.insert(“one”); set.insert(“three”); set.insert(“seven”);

Another way to insert items into the set is to use operator<<():

set << “twelve” << “fifteen” << “nineteen”;

To test whether an item belongs to the set or not, use contains():

if (!set.contains(“ninety-nine”)) ...

If you want to navigate through all the values stored in a QSet, you can use an iterator. QSet supports both Java-style iterators (QSetIterator and QMutableSetIterator) and STL-style iterators (QSet::iterator and QSet::const_iterator). Here's how to iterate over a QSet<QWidget *> using a Java-style iterator:

QSetIterator<QWidget *> i(set); while (i.hasNext()) qDebug() << i.next();

Here's the same code, but using an STL-style iterator:

QSet<QWidget >::const_iterator i = set.constBegin(); while (i != set.constEnd()) { qDebug() << i; ++i; }

QSet is unordered, so an iterator's sequence cannot be assumed to be predictable. If ordering by key is required, use a QMap.

To navigate through a QSet, you can also use foreach:

QSet<QString> set; ... foreach (const QString &value, set) qDebug() << value;

Items can be removed from the set using remove(). There is also a clear() function that removes all items.

QSet's value data type must be an assignable data type. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. In addition, the type must provide operator==(), and there must also be a global qHash() function that returns a hash value for an argument of the key's type. See the QHash documentation for a list of types supported by qHash().

Internally, QSet uses a hash table to perform lookups. The hash table automatically grows and shrinks to provide fast lookups without wasting memory. You can still control the size of the hash table by calling reserve(), if you already know approximately how many elements the QSet will contain, but this isn't necessary to obtain good performance. You can also call capacity() to retrieve the hash table's size.

source

pub unsafe fn count(&self) -> c_int

Same as size().

Calls C++ function: int QSet<QAbstractState*>::count() const.

C++ documentation:

Same as size().

source

pub unsafe fn detach(&self)

Calls C++ function: void QSet<QAbstractState*>::detach().

source

pub unsafe fn empty(&self) -> bool

Returns true if the set is empty. This function is provided for STL compatibility. It is equivalent to isEmpty().

Calls C++ function: bool QSet<QAbstractState*>::empty() const.

C++ documentation:

Returns true if the set is empty. This function is provided for STL compatibility. It is equivalent to isEmpty().

source

pub unsafe fn end_mut(&self) -> CppBox<Iterator>

This is an overloaded function.

Calls C++ function: QSet<QAbstractState*>::iterator QSet<QAbstractState*>::end().

C++ documentation:

This is an overloaded function.

Returns a non-const STL-style iterator pointing to the imaginary item after the last item in the set.

This function was introduced in Qt 4.2.

source

pub unsafe fn end(&self) -> CppBox<ConstIterator>

Returns a const STL-style iterator positioned at the imaginary item after the last item in the set.

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::end() const.

C++ documentation:

Returns a const STL-style iterator positioned at the imaginary item after the last item in the set.

See also constEnd() and begin().

source

pub unsafe fn erase_iterator( &self, i: impl CastInto<Ref<Iterator>> ) -> CppBox<Iterator>

This is an overloaded function.

Calls C++ function: QSet<QAbstractState*>::iterator QSet<QAbstractState*>::erase(QSet<QAbstractState*>::iterator i).

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.2.

source

pub unsafe fn erase_const_iterator( &self, i: impl CastInto<Ref<ConstIterator>> ) -> CppBox<Iterator>

Removes the item at the iterator position pos from the set, and returns an iterator positioned at the next item in the set.

Calls C++ function: QSet<QAbstractState*>::iterator QSet<QAbstractState*>::erase(QSet<QAbstractState*>::const_iterator i).

C++ documentation:

Removes the item at the iterator position pos from the set, and returns an iterator positioned at the next item in the set.

Unlike remove(), this function never causes QSet to rehash its internal data structure. This means that it can safely be called while iterating, and won't affect the order of items in the set.

This function was introduced in Qt 5.7.

See also remove() and find().

source

pub unsafe fn find_mut( &self, value: *const *mut QAbstractState ) -> CppBox<Iterator>

This is an overloaded function.

Calls C++ function: QSet<QAbstractState*>::iterator QSet<QAbstractState*>::find(const QAbstractState*& value).

C++ documentation:

This is an overloaded function.

Returns a non-const iterator positioned at the item value in the set. If the set contains no item value, the function returns end().

This function was introduced in Qt 4.2.

source

pub unsafe fn find( &self, value: *const *mut QAbstractState ) -> CppBox<ConstIterator>

Returns a const iterator positioned at the item value in the set. If the set contains no item value, the function returns constEnd().

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::find(const QAbstractState*& value) const.

C++ documentation:

Returns a const iterator positioned at the item value in the set. If the set contains no item value, the function returns constEnd().

This function was introduced in Qt 4.2.

See also constFind() and contains().

source

pub unsafe fn from_list( list: impl CastInto<Ref<QListOfQAbstractState>> ) -> CppBox<QSetOfQAbstractState>

Returns a new QSet object containing the data contained in list. Since QSet doesn't allow duplicates, the resulting QSet might be smaller than the list, because QList can contain duplicates.

Calls C++ function: static QSet<QAbstractState*> QSet<QAbstractState*>::fromList(const QList<QAbstractState*>& list).

C++ documentation:

Returns a new QSet object containing the data contained in list. Since QSet doesn’t allow duplicates, the resulting QSet might be smaller than the list, because QList can contain duplicates.

Example:

QStringList list; list << “Julia” << “Mike” << “Mike” << “Julia” << “Julia”;

QSet<QString> set = QSet<QString>::fromList(list); set.contains(“Julia”); // returns true set.contains(“Mike”); // returns true set.size(); // returns 2

See also toList() and QList::toSet().

source

pub unsafe fn insert( &self, value: *const *mut QAbstractState ) -> CppBox<Iterator>

Inserts item value into the set, if value isn't already in the set, and returns an iterator pointing at the inserted item.

Calls C++ function: QSet<QAbstractState*>::iterator QSet<QAbstractState*>::insert(const QAbstractState*& value).

C++ documentation:

Inserts item value into the set, if value isn’t already in the set, and returns an iterator pointing at the inserted item.

See also operator<<(), remove(), and contains().

source

pub unsafe fn intersect( &self, other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> Ref<QSetOfQAbstractState>

Removes all items from this set that are not contained in the other set. A reference to this set is returned.

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::intersect(const QSet<QAbstractState*>& other).

C++ documentation:

Removes all items from this set that are not contained in the other set. A reference to this set is returned.

See also intersects(), operator&=(), unite(), and subtract().

source

pub unsafe fn intersects( &self, other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> bool

Returns true if this set has at least one item in common with other.

Calls C++ function: bool QSet<QAbstractState*>::intersects(const QSet<QAbstractState*>& other) const.

C++ documentation:

Returns true if this set has at least one item in common with other.

This function was introduced in Qt 5.6.

See also contains() and intersect().

source

pub unsafe fn is_detached(&self) -> bool

Calls C++ function: bool QSet<QAbstractState*>::isDetached() const.

source

pub unsafe fn is_empty(&self) -> bool

Returns true if the set contains no elements; otherwise returns false.

Calls C++ function: bool QSet<QAbstractState*>::isEmpty() const.

C++ documentation:

Returns true if the set contains no elements; otherwise returns false.

See also size().

source

pub unsafe fn new() -> CppBox<QSetOfQAbstractState>

Constructs an empty set.

Calls C++ function: [constructor] void QSet<QAbstractState*>::QSet().

C++ documentation:

Constructs an empty set.

See also clear().

source

pub unsafe fn new_copy( other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> CppBox<QSetOfQAbstractState>

The QSet class is a template class that provides a hash-table-based set.

Calls C++ function: [constructor] void QSet<QAbstractState*>::QSet(const QSet<QAbstractState*>& other).

C++ documentation:

The QSet class is a template class that provides a hash-table-based set.

QSet<T> is one of Qt's generic container classes. It stores values in an unspecified order and provides very fast lookup of the values. Internally, QSet<T> is implemented as a QHash.

Here's an example QSet with QString values:

QSet<QString> set;

To insert a value into the set, use insert():

set.insert(“one”); set.insert(“three”); set.insert(“seven”);

Another way to insert items into the set is to use operator<<():

set << “twelve” << “fifteen” << “nineteen”;

To test whether an item belongs to the set or not, use contains():

if (!set.contains(“ninety-nine”)) ...

If you want to navigate through all the values stored in a QSet, you can use an iterator. QSet supports both Java-style iterators (QSetIterator and QMutableSetIterator) and STL-style iterators (QSet::iterator and QSet::const_iterator). Here's how to iterate over a QSet<QWidget *> using a Java-style iterator:

QSetIterator<QWidget *> i(set); while (i.hasNext()) qDebug() << i.next();

Here's the same code, but using an STL-style iterator:

QSet<QWidget >::const_iterator i = set.constBegin(); while (i != set.constEnd()) { qDebug() << i; ++i; }

QSet is unordered, so an iterator's sequence cannot be assumed to be predictable. If ordering by key is required, use a QMap.

To navigate through a QSet, you can also use foreach:

QSet<QString> set; ... foreach (const QString &value, set) qDebug() << value;

Items can be removed from the set using remove(). There is also a clear() function that removes all items.

QSet's value data type must be an assignable data type. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. In addition, the type must provide operator==(), and there must also be a global qHash() function that returns a hash value for an argument of the key's type. See the QHash documentation for a list of types supported by qHash().

Internally, QSet uses a hash table to perform lookups. The hash table automatically grows and shrinks to provide fast lookups without wasting memory. You can still control the size of the hash table by calling reserve(), if you already know approximately how many elements the QSet will contain, but this isn't necessary to obtain good performance. You can also call capacity() to retrieve the hash table's size.

source

pub unsafe fn remove(&self, value: *const *mut QAbstractState) -> bool

Removes any occurrence of item value from the set. Returns true if an item was actually removed; otherwise returns false.

Calls C++ function: bool QSet<QAbstractState*>::remove(const QAbstractState*& value).

C++ documentation:

Removes any occurrence of item value from the set. Returns true if an item was actually removed; otherwise returns false.

See also contains() and insert().

source

pub unsafe fn reserve(&self, size: c_int)

Ensures that the set's internal hash table consists of at least size buckets.

Calls C++ function: void QSet<QAbstractState*>::reserve(int size).

C++ documentation:

Ensures that the set’s internal hash table consists of at least size buckets.

This function is useful for code that needs to build a huge set and wants to avoid repeated reallocation. For example:

QSet<QString> set; set.reserve(20000); for (int i = 0; i < 20000; ++i) set.insert(values[i]);

Ideally, size should be slightly more than the maximum number of elements expected in the set. size doesn't have to be prime, because QSet will use a prime number internally anyway. If size is an underestimate, the worst that will happen is that the QSet will be a bit slower.

In general, you will rarely ever need to call this function. QSet's internal hash table automatically shrinks or grows to provide good performance without wasting too much memory.

See also squeeze() and capacity().

source

pub unsafe fn set_sharable(&self, sharable: bool)

Calls C++ function: void QSet<QAbstractState*>::setSharable(bool sharable).

source

pub unsafe fn size(&self) -> c_int

Returns the number of items in the set.

Calls C++ function: int QSet<QAbstractState*>::size() const.

C++ documentation:

Returns the number of items in the set.

See also isEmpty() and count().

source

pub unsafe fn squeeze(&self)

Reduces the size of the set's internal hash table to save memory.

Calls C++ function: void QSet<QAbstractState*>::squeeze().

C++ documentation:

Reduces the size of the set’s internal hash table to save memory.

The sole purpose of this function is to provide a means of fine tuning QSet's memory usage. In general, you will rarely ever need to call this function.

See also reserve() and capacity().

source

pub unsafe fn sub_assign_q_set_of_q_abstract_state( &self, other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> Ref<QSetOfQAbstractState>

Same as subtract(other).

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator-=(const QSet<QAbstractState*>& other).

C++ documentation:

Same as subtract(other).

See also operator-(), operator|=(), and operator&=().

source

pub unsafe fn sub_assign_q_abstract_state( &self, value: *const *mut QAbstractState ) -> Ref<QSetOfQAbstractState>

Removes the occurrence of item value from the set, if it is found, and returns a reference to the set. If the value is not contained the set, nothing is removed.

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator-=(const QAbstractState*& value).

C++ documentation:

Removes the occurrence of item value from the set, if it is found, and returns a reference to the set. If the value is not contained the set, nothing is removed.

See also remove().

source

pub unsafe fn subtract( &self, other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> Ref<QSetOfQAbstractState>

Removes all items from this set that are contained in the other set. Returns a reference to this set.

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::subtract(const QSet<QAbstractState*>& other).

C++ documentation:

Removes all items from this set that are contained in the other set. Returns a reference to this set.

See also operator-=(), unite(), and intersect().

source

pub unsafe fn swap(&self, other: impl CastInto<Ref<QSetOfQAbstractState>>)

Swaps set other with this set. This operation is very fast and never fails.

Calls C++ function: void QSet<QAbstractState*>::swap(QSet<QAbstractState*>& other).

C++ documentation:

Swaps set other with this set. This operation is very fast and never fails.

source

pub unsafe fn to_list(&self) -> CppBox<QListOfQAbstractState>

Returns a new QList containing the elements in the set. The order of the elements in the QList is undefined.

Calls C++ function: QList<QAbstractState*> QSet<QAbstractState*>::toList() const.

C++ documentation:

Returns a new QList containing the elements in the set. The order of the elements in the QList is undefined.

Example:

QSet<QString> set; set << “red” << “green” << “blue” << ... << “black”;

QList<QString> list = set.toList(); qSort(list);

See also fromList() and QList::fromSet().

source

pub unsafe fn unite( &self, other: impl CastInto<Ref<QSetOfQAbstractState>> ) -> Ref<QSetOfQAbstractState>

Each item in the other set that isn't already in this set is inserted into this set. A reference to this set is returned.

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::unite(const QSet<QAbstractState*>& other).

C++ documentation:

Each item in the other set that isn’t already in this set is inserted into this set. A reference to this set is returned.

See also operator|=(), intersect(), and subtract().

source

pub unsafe fn values(&self) -> CppBox<QListOfQAbstractState>

Returns a new QList containing the elements in the set. The order of the elements in the QList is undefined.

Calls C++ function: QList<QAbstractState*> QSet<QAbstractState*>::values() const.

C++ documentation:

Returns a new QList containing the elements in the set. The order of the elements in the QList is undefined.

This is the same as toList().

See also fromList() and QList::fromSet().

Trait Implementations§

source§

impl Add<Ref<QSetOfQAbstractState>> for &QSetOfQAbstractState

source§

fn add(self, other: Ref<QSetOfQAbstractState>) -> CppBox<QSetOfQAbstractState>

Returns a new QSet that is the union of this set and the other set.

Calls C++ function: QSet<QAbstractState*> QSet<QAbstractState*>::operator+(const QSet<QAbstractState*>& other) const.

C++ documentation:

Returns a new QSet that is the union of this set and the other set.

See also unite(), operator|=(), operator&(), and operator-().

§

type Output = CppBox<QSetOfQAbstractState>

The resulting type after applying the + operator.
source§

impl Begin for QSetOfQAbstractState

source§

unsafe fn begin(&self) -> CppBox<ConstIterator>

Returns a const STL-style iterator positioned at the first item in the set.

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::begin() const.

C++ documentation:

Returns a const STL-style iterator positioned at the first item in the set.

See also constBegin() and end().

§

type Output = CppBox<ConstIterator>

Output type.
source§

impl BeginMut for QSetOfQAbstractState

source§

unsafe fn begin_mut(&self) -> CppBox<Iterator>

This is an overloaded function.

Calls C++ function: QSet<QAbstractState*>::iterator QSet<QAbstractState*>::begin().

C++ documentation:

This is an overloaded function.

Returns a non-const STL-style iterator positioned at the first item in the set.

This function was introduced in Qt 4.2.

§

type Output = CppBox<Iterator>

Output type.
source§

impl BitAnd<Ref<QSetOfQAbstractState>> for &QSetOfQAbstractState

source§

fn bitand( self, other: Ref<QSetOfQAbstractState> ) -> CppBox<QSetOfQAbstractState>

Returns a new QSet that is the intersection of this set and the other set.

Calls C++ function: QSet<QAbstractState*> QSet<QAbstractState*>::operator&(const QSet<QAbstractState*>& other) const.

C++ documentation:

Returns a new QSet that is the intersection of this set and the other set.

See also intersect(), operator&=(), operator|(), and operator-().

§

type Output = CppBox<QSetOfQAbstractState>

The resulting type after applying the & operator.
source§

impl BitOr<Ref<QSetOfQAbstractState>> for &QSetOfQAbstractState

source§

fn bitor(self, other: Ref<QSetOfQAbstractState>) -> CppBox<QSetOfQAbstractState>

Returns a new QSet that is the union of this set and the other set.

Calls C++ function: QSet<QAbstractState*> QSet<QAbstractState*>::operator|(const QSet<QAbstractState*>& other) const.

C++ documentation:

Returns a new QSet that is the union of this set and the other set.

See also unite(), operator|=(), operator&(), and operator-().

§

type Output = CppBox<QSetOfQAbstractState>

The resulting type after applying the | operator.
source§

impl CppDeletable for QSetOfQAbstractState

source§

unsafe fn delete(&self)

The QSet class is a template class that provides a hash-table-based set.

Calls C++ function: [destructor] void QSet<QAbstractState*>::~QSet().

C++ documentation:

The QSet class is a template class that provides a hash-table-based set.

QSet<T> is one of Qt's generic container classes. It stores values in an unspecified order and provides very fast lookup of the values. Internally, QSet<T> is implemented as a QHash.

Here's an example QSet with QString values:

QSet<QString> set;

To insert a value into the set, use insert():

set.insert(“one”); set.insert(“three”); set.insert(“seven”);

Another way to insert items into the set is to use operator<<():

set << “twelve” << “fifteen” << “nineteen”;

To test whether an item belongs to the set or not, use contains():

if (!set.contains(“ninety-nine”)) ...

If you want to navigate through all the values stored in a QSet, you can use an iterator. QSet supports both Java-style iterators (QSetIterator and QMutableSetIterator) and STL-style iterators (QSet::iterator and QSet::const_iterator). Here's how to iterate over a QSet<QWidget *> using a Java-style iterator:

QSetIterator<QWidget *> i(set); while (i.hasNext()) qDebug() << i.next();

Here's the same code, but using an STL-style iterator:

QSet<QWidget >::const_iterator i = set.constBegin(); while (i != set.constEnd()) { qDebug() << i; ++i; }

QSet is unordered, so an iterator's sequence cannot be assumed to be predictable. If ordering by key is required, use a QMap.

To navigate through a QSet, you can also use foreach:

QSet<QString> set; ... foreach (const QString &value, set) qDebug() << value;

Items can be removed from the set using remove(). There is also a clear() function that removes all items.

QSet's value data type must be an assignable data type. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. In addition, the type must provide operator==(), and there must also be a global qHash() function that returns a hash value for an argument of the key's type. See the QHash documentation for a list of types supported by qHash().

Internally, QSet uses a hash table to perform lookups. The hash table automatically grows and shrinks to provide fast lookups without wasting memory. You can still control the size of the hash table by calling reserve(), if you already know approximately how many elements the QSet will contain, but this isn't necessary to obtain good performance. You can also call capacity() to retrieve the hash table's size.

source§

impl End for QSetOfQAbstractState

source§

unsafe fn end(&self) -> CppBox<ConstIterator>

Returns a const STL-style iterator positioned at the imaginary item after the last item in the set.

Calls C++ function: QSet<QAbstractState*>::const_iterator QSet<QAbstractState*>::end() const.

C++ documentation:

Returns a const STL-style iterator positioned at the imaginary item after the last item in the set.

See also constEnd() and begin().

§

type Output = CppBox<ConstIterator>

Output type.
source§

impl EndMut for QSetOfQAbstractState

source§

unsafe fn end_mut(&self) -> CppBox<Iterator>

This is an overloaded function.

Calls C++ function: QSet<QAbstractState*>::iterator QSet<QAbstractState*>::end().

C++ documentation:

This is an overloaded function.

Returns a non-const STL-style iterator pointing to the imaginary item after the last item in the set.

This function was introduced in Qt 4.2.

§

type Output = CppBox<Iterator>

Output type.
source§

impl PartialEq<Ref<QSetOfQAbstractState>> for QSetOfQAbstractState

source§

fn eq(&self, other: &Ref<QSetOfQAbstractState>) -> bool

Returns true if the other set is equal to this set; otherwise returns false.

Calls C++ function: bool QSet<QAbstractState*>::operator==(const QSet<QAbstractState*>& other) const.

C++ documentation:

Returns true if the other set is equal to this set; otherwise returns false.

Two sets are considered equal if they contain the same elements.

This function requires the value type to implement operator==().

See also operator!=().

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Shl<*const *mut QAbstractState> for &QSetOfQAbstractState

source§

fn shl(self, value: *const *mut QAbstractState) -> Ref<QSetOfQAbstractState>

Inserts a new item value and returns a reference to the set. If value already exists in the set, the set is left unchanged.

Calls C++ function: QSet<QAbstractState*>& QSet<QAbstractState*>::operator<<(const QAbstractState*& value).

C++ documentation:

Inserts a new item value and returns a reference to the set. If value already exists in the set, the set is left unchanged.

See also insert().

§

type Output = Ref<QSetOfQAbstractState>

The resulting type after applying the << operator.
source§

impl Size for QSetOfQAbstractState

source§

unsafe fn size(&self) -> usize

Returns the number of items in the set.

Calls C++ function: int QSet<QAbstractState*>::size() const.

C++ documentation:

Returns the number of items in the set.

See also isEmpty() and count().

source§

impl Sub<Ref<QSetOfQAbstractState>> for &QSetOfQAbstractState

source§

fn sub(self, other: Ref<QSetOfQAbstractState>) -> CppBox<QSetOfQAbstractState>

Returns a new QSet that is the set difference of this set and the other set, i.e., this set - other set.

Calls C++ function: QSet<QAbstractState*> QSet<QAbstractState*>::operator-(const QSet<QAbstractState*>& other) const.

C++ documentation:

Returns a new QSet that is the set difference of this set and the other set, i.e., this set - other set.

See also subtract(), operator-=(), operator|(), and operator&().

§

type Output = CppBox<QSetOfQAbstractState>

The resulting type after applying the - operator.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.