[][src]Struct qt_gui::QSetOfQByteArray

#[repr(C)]pub struct QSetOfQByteArray { /* fields omitted */ }

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

C++ class: QSet<QByteArray>.

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.

Methods

impl QSetOfQByteArray[src]

pub unsafe fn add_assign_q_set_of_q_byte_array(
    &self,
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

Same as unite(other).

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

C++ documentation:

Same as unite(other).

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

pub unsafe fn add_assign_q_byte_array(
    &self,
    value: impl CastInto<Ref<QByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

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<QByteArray>& QSet<QByteArray>::operator+=(const QByteArray& 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().

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

This is an overloaded function.

Calls C++ function: QSet<QByteArray>::iterator QSet<QByteArray>::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.

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

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

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

C++ documentation:

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

See also constBegin() and end().

pub unsafe fn bit_and_assign_q_set_of_q_byte_array(
    &self,
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

Same as intersect(other).

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

C++ documentation:

Same as intersect(other).

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

pub unsafe fn bit_and_assign_q_byte_array(
    &self,
    value: impl CastInto<Ref<QByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

This is an overloaded function.

Calls C++ function: QSet<QByteArray>& QSet<QByteArray>::operator&=(const QByteArray& 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.

pub unsafe fn bit_or_assign_q_set_of_q_byte_array(
    &self,
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

Same as unite(other).

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

C++ documentation:

Same as unite(other).

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

pub unsafe fn bit_or_assign_q_byte_array(
    &self,
    value: impl CastInto<Ref<QByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

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<QByteArray>& QSet<QByteArray>::operator|=(const QByteArray& 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().

pub unsafe fn capacity(&self) -> c_int[src]

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

Calls C++ function: int QSet<QByteArray>::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().

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

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

Calls C++ function: QSet<QByteArray>::const_iterator QSet<QByteArray>::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().

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

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

Calls C++ function: QSet<QByteArray>::const_iterator QSet<QByteArray>::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().

pub unsafe fn clear(&self)[src]

Removes all elements from the set.

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

C++ documentation:

Removes all elements from the set.

See also remove().

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

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

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

C++ documentation:

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

See also begin() and constEnd().

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

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

Calls C++ function: QSet<QByteArray>::const_iterator QSet<QByteArray>::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().

pub unsafe fn const_find(
    &self,
    value: impl CastInto<Ref<QByteArray>>
) -> CppBox<ConstIterator>
[src]

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<QByteArray>::const_iterator QSet<QByteArray>::constFind(const QByteArray& 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().

pub unsafe fn contains_q_byte_array(
    &self,
    value: impl CastInto<Ref<QByteArray>>
) -> bool
[src]

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

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

C++ documentation:

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

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

pub unsafe fn contains_q_set_of_q_byte_array(
    &self,
    set: impl CastInto<Ref<QSetOfQByteArray>>
) -> bool
[src]

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

Calls C++ function: bool QSet<QByteArray>::contains(const QSet<QByteArray>& 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().

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

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

Calls C++ function: QSet<QByteArray>& QSet<QByteArray>::operator=(const QSet<QByteArray>& 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.

pub unsafe fn count(&self) -> c_int[src]

Same as size().

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

C++ documentation:

Same as size().

pub unsafe fn detach(&self)[src]

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

pub unsafe fn empty(&self) -> bool[src]

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

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

C++ documentation:

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

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

This is an overloaded function.

Calls C++ function: QSet<QByteArray>::iterator QSet<QByteArray>::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.

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

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

Calls C++ function: QSet<QByteArray>::const_iterator QSet<QByteArray>::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().

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

This is an overloaded function.

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

C++ documentation:

This is an overloaded function.

This function was introduced in Qt 4.2.

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

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<QByteArray>::iterator QSet<QByteArray>::erase(QSet<QByteArray>::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().

pub unsafe fn find_mut(
    &self,
    value: impl CastInto<Ref<QByteArray>>
) -> CppBox<Iterator>
[src]

This is an overloaded function.

Calls C++ function: QSet<QByteArray>::iterator QSet<QByteArray>::find(const QByteArray& 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.

pub unsafe fn find(
    &self,
    value: impl CastInto<Ref<QByteArray>>
) -> CppBox<ConstIterator>
[src]

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<QByteArray>::const_iterator QSet<QByteArray>::find(const QByteArray& 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().

pub unsafe fn from_list(
    list: impl CastInto<Ref<QListOfQByteArray>>
) -> CppBox<QSetOfQByteArray>
[src]

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<QByteArray> QSet<QByteArray>::fromList(const QList<QByteArray>& 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().

pub unsafe fn insert(
    &self,
    value: impl CastInto<Ref<QByteArray>>
) -> CppBox<Iterator>
[src]

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<QByteArray>::iterator QSet<QByteArray>::insert(const QByteArray& 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().

pub unsafe fn intersect(
    &self,
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

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<QByteArray>& QSet<QByteArray>::intersect(const QSet<QByteArray>& 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().

pub unsafe fn intersects(
    &self,
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> bool
[src]

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

Calls C++ function: bool QSet<QByteArray>::intersects(const QSet<QByteArray>& 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().

pub unsafe fn is_detached(&self) -> bool[src]

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

pub unsafe fn is_empty(&self) -> bool[src]

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

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

C++ documentation:

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

See also size().

pub unsafe fn new() -> CppBox<QSetOfQByteArray>[src]

Constructs an empty set.

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

C++ documentation:

Constructs an empty set.

See also clear().

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> CppBox<QSetOfQByteArray>
[src]

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

Calls C++ function: [constructor] void QSet<QByteArray>::QSet(const QSet<QByteArray>& 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.

pub unsafe fn remove(&self, value: impl CastInto<Ref<QByteArray>>) -> bool[src]

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<QByteArray>::remove(const QByteArray& 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().

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

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

Calls C++ function: void QSet<QByteArray>::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().

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

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

pub unsafe fn size(&self) -> c_int[src]

Returns the number of items in the set.

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

C++ documentation:

Returns the number of items in the set.

See also isEmpty() and count().

pub unsafe fn squeeze(&self)[src]

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

Calls C++ function: void QSet<QByteArray>::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().

pub unsafe fn sub_assign_q_set_of_q_byte_array(
    &self,
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

Same as subtract(other).

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

C++ documentation:

Same as subtract(other).

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

pub unsafe fn sub_assign_q_byte_array(
    &self,
    value: impl CastInto<Ref<QByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

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<QByteArray>& QSet<QByteArray>::operator-=(const QByteArray& 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().

pub unsafe fn subtract(
    &self,
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

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

Calls C++ function: QSet<QByteArray>& QSet<QByteArray>::subtract(const QSet<QByteArray>& 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().

pub unsafe fn swap(&self, other: impl CastInto<Ref<QSetOfQByteArray>>)[src]

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

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

C++ documentation:

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

pub unsafe fn to_list(&self) -> CppBox<QListOfQByteArray>[src]

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

Calls C++ function: QList<QByteArray> QSet<QByteArray>::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().

pub unsafe fn unite(
    &self,
    other: impl CastInto<Ref<QSetOfQByteArray>>
) -> Ref<QSetOfQByteArray>
[src]

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<QByteArray>& QSet<QByteArray>::unite(const QSet<QByteArray>& 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().

pub unsafe fn values(&self) -> CppBox<QListOfQByteArray>[src]

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

Calls C++ function: QList<QByteArray> QSet<QByteArray>::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

impl<'_> Add<Ref<QSetOfQByteArray>> for &'_ QSetOfQByteArray[src]

type Output = CppBox<QSetOfQByteArray>

The resulting type after applying the + operator.

fn add(self, other: Ref<QSetOfQByteArray>) -> CppBox<QSetOfQByteArray>[src]

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

Calls C++ function: QSet<QByteArray> QSet<QByteArray>::operator+(const QSet<QByteArray>& 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-().

impl Begin for QSetOfQByteArray[src]

type Output = CppBox<ConstIterator>

Output type.

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

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

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

C++ documentation:

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

See also constBegin() and end().

impl BeginMut for QSetOfQByteArray[src]

type Output = CppBox<Iterator>

Output type.

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

This is an overloaded function.

Calls C++ function: QSet<QByteArray>::iterator QSet<QByteArray>::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.

impl<'_> BitAnd<Ref<QSetOfQByteArray>> for &'_ QSetOfQByteArray[src]

type Output = CppBox<QSetOfQByteArray>

The resulting type after applying the & operator.

fn bitand(self, other: Ref<QSetOfQByteArray>) -> CppBox<QSetOfQByteArray>[src]

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

Calls C++ function: QSet<QByteArray> QSet<QByteArray>::operator&(const QSet<QByteArray>& 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-().

impl<'_> BitOr<Ref<QSetOfQByteArray>> for &'_ QSetOfQByteArray[src]

type Output = CppBox<QSetOfQByteArray>

The resulting type after applying the | operator.

fn bitor(self, other: Ref<QSetOfQByteArray>) -> CppBox<QSetOfQByteArray>[src]

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

Calls C++ function: QSet<QByteArray> QSet<QByteArray>::operator|(const QSet<QByteArray>& 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-().

impl CppDeletable for QSetOfQByteArray[src]

unsafe fn delete(&self)[src]

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

Calls C++ function: [destructor] void QSet<QByteArray>::~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.

impl End for QSetOfQByteArray[src]

type Output = CppBox<ConstIterator>

Output type.

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

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

Calls C++ function: QSet<QByteArray>::const_iterator QSet<QByteArray>::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().

impl EndMut for QSetOfQByteArray[src]

type Output = CppBox<Iterator>

Output type.

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

This is an overloaded function.

Calls C++ function: QSet<QByteArray>::iterator QSet<QByteArray>::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.

impl PartialEq<Ref<QSetOfQByteArray>> for QSetOfQByteArray[src]

fn eq(&self, other: &Ref<QSetOfQByteArray>) -> bool[src]

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

Calls C++ function: bool QSet<QByteArray>::operator==(const QSet<QByteArray>& 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!=().

impl<'_> Shl<Ref<QByteArray>> for &'_ QSetOfQByteArray[src]

type Output = Ref<QSetOfQByteArray>

The resulting type after applying the << operator.

fn shl(self, value: Ref<QByteArray>) -> Ref<QSetOfQByteArray>[src]

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<QByteArray>& QSet<QByteArray>::operator<<(const QByteArray& 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().

impl Size for QSetOfQByteArray[src]

unsafe fn size(&self) -> usize[src]

Returns the number of items in the set.

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

C++ documentation:

Returns the number of items in the set.

See also isEmpty() and count().

impl<'_> Sub<Ref<QSetOfQByteArray>> for &'_ QSetOfQByteArray[src]

type Output = CppBox<QSetOfQByteArray>

The resulting type after applying the - operator.

fn sub(self, other: Ref<QSetOfQByteArray>) -> CppBox<QSetOfQByteArray>[src]

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<QByteArray> QSet<QByteArray>::operator-(const QSet<QByteArray>& 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&().

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.