[][src]Struct qt_core::QItemSelection

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

The QItemSelection class manages information about selected items in a model.

C++ class: QItemSelection.

C++ documentation:

The QItemSelection class manages information about selected items in a model.

A QItemSelection describes the items in a model that have been selected by the user. A QItemSelection is basically a list of selection ranges, see QItemSelectionRange. It provides functions for creating and manipulating selections, and selecting a range of items from a model.

The QItemSelection class is one of the Model/View Classes and is part of Qt's model/view framework.

An item selection can be constructed and initialized to contain a range of items from an existing model. The following example constructs a selection that contains a range of items from the given model, beginning at the topLeft, and ending at the bottomRight.

QItemSelection *selection = new QItemSelection(topLeft, bottomRight);

An empty item selection can be constructed, and later populated as required. So, if the model is going to be unavailable when we construct the item selection, we can rewrite the above code in the following way:

QItemSelection *selection = new QItemSelection(); ... selection->select(topLeft, bottomRight);

QItemSelection saves memory, and avoids unnecessary work, by working with selection ranges rather than recording the model item index for each item in the selection. Generally, an instance of this class will contain a list of non-overlapping selection ranges.

Use merge() to merge one item selection into another without making overlapping ranges. Use split() to split one selection range into smaller ranges based on a another selection range.

Methods

impl QItemSelection[src]

pub unsafe fn contains(&self, index: impl CastInto<Ref<QModelIndex>>) -> bool[src]

Returns true if the selection contains the given index; otherwise returns false.

Calls C++ function: bool QItemSelection::contains(const QModelIndex& index) const.

C++ documentation:

Returns true if the selection contains the given index; otherwise returns false.

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

The QItemSelection class manages information about selected items in a model.

Calls C++ function: QItemSelection& QItemSelection::operator=(const QItemSelection& other).

C++ documentation:

The QItemSelection class manages information about selected items in a model.

A QItemSelection describes the items in a model that have been selected by the user. A QItemSelection is basically a list of selection ranges, see QItemSelectionRange. It provides functions for creating and manipulating selections, and selecting a range of items from a model.

The QItemSelection class is one of the Model/View Classes and is part of Qt's model/view framework.

An item selection can be constructed and initialized to contain a range of items from an existing model. The following example constructs a selection that contains a range of items from the given model, beginning at the topLeft, and ending at the bottomRight.

QItemSelection *selection = new QItemSelection(topLeft, bottomRight);

An empty item selection can be constructed, and later populated as required. So, if the model is going to be unavailable when we construct the item selection, we can rewrite the above code in the following way:

QItemSelection *selection = new QItemSelection(); ... selection->select(topLeft, bottomRight);

QItemSelection saves memory, and avoids unnecessary work, by working with selection ranges rather than recording the model item index for each item in the selection. Generally, an instance of this class will contain a list of non-overlapping selection ranges.

Use merge() to merge one item selection into another without making overlapping ranges. Use split() to split one selection range into smaller ranges based on a another selection range.

pub unsafe fn indexes(&self) -> CppBox<QListOfQModelIndex>[src]

Returns a list of model indexes that correspond to the selected items.

Calls C++ function: QList<QModelIndex> QItemSelection::indexes() const.

C++ documentation:

Returns a list of model indexes that correspond to the selected items.

pub unsafe fn merge(
    &mut self,
    other: impl CastInto<Ref<QItemSelection>>,
    command: QFlags<SelectionFlag>
)
[src]

Merges the other selection with this QItemSelection using the command given. This method guarantees that no ranges are overlapping.

Calls C++ function: void QItemSelection::merge(const QItemSelection& other, QFlags<QItemSelectionModel::SelectionFlag> command).

C++ documentation:

Merges the other selection with this QItemSelection using the command given. This method guarantees that no ranges are overlapping.

Note that only QItemSelectionModel::Select, QItemSelectionModel::Deselect, and QItemSelectionModel::Toggle are supported.

See also split().

pub unsafe fn new_0a() -> CppBox<QItemSelection>[src]

Constructs an empty selection.

Calls C++ function: [constructor] void QItemSelection::QItemSelection().

C++ documentation:

Constructs an empty selection.

pub unsafe fn new_2a(
    top_left: impl CastInto<Ref<QModelIndex>>,
    bottom_right: impl CastInto<Ref<QModelIndex>>
) -> CppBox<QItemSelection>
[src]

Constructs an item selection that extends from the top-left model item, specified by the topLeft index, to the bottom-right item, specified by bottomRight.

Calls C++ function: [constructor] void QItemSelection::QItemSelection(const QModelIndex& topLeft, const QModelIndex& bottomRight).

C++ documentation:

Constructs an item selection that extends from the top-left model item, specified by the topLeft index, to the bottom-right item, specified by bottomRight.

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

The QItemSelection class manages information about selected items in a model.

Calls C++ function: [constructor] void QItemSelection::QItemSelection(const QItemSelection& other).

C++ documentation:

The QItemSelection class manages information about selected items in a model.

A QItemSelection describes the items in a model that have been selected by the user. A QItemSelection is basically a list of selection ranges, see QItemSelectionRange. It provides functions for creating and manipulating selections, and selecting a range of items from a model.

The QItemSelection class is one of the Model/View Classes and is part of Qt's model/view framework.

An item selection can be constructed and initialized to contain a range of items from an existing model. The following example constructs a selection that contains a range of items from the given model, beginning at the topLeft, and ending at the bottomRight.

QItemSelection *selection = new QItemSelection(topLeft, bottomRight);

An empty item selection can be constructed, and later populated as required. So, if the model is going to be unavailable when we construct the item selection, we can rewrite the above code in the following way:

QItemSelection *selection = new QItemSelection(); ... selection->select(topLeft, bottomRight);

QItemSelection saves memory, and avoids unnecessary work, by working with selection ranges rather than recording the model item index for each item in the selection. Generally, an instance of this class will contain a list of non-overlapping selection ranges.

Use merge() to merge one item selection into another without making overlapping ranges. Use split() to split one selection range into smaller ranges based on a another selection range.

pub unsafe fn select(
    &mut self,
    top_left: impl CastInto<Ref<QModelIndex>>,
    bottom_right: impl CastInto<Ref<QModelIndex>>
)
[src]

Adds the items in the range that extends from the top-left model item, specified by the topLeft index, to the bottom-right item, specified by bottomRight to the list.

Calls C++ function: void QItemSelection::select(const QModelIndex& topLeft, const QModelIndex& bottomRight).

C++ documentation:

Adds the items in the range that extends from the top-left model item, specified by the topLeft index, to the bottom-right item, specified by bottomRight to the list.

Note: topLeft and bottomRight must have the same parent.

pub unsafe fn split(
    range: impl CastInto<Ref<QItemSelectionRange>>,
    other: impl CastInto<Ref<QItemSelectionRange>>,
    result: impl CastInto<MutPtr<QItemSelection>>
)
[src]

Splits the selection range using the selection other range. Removes all items in other from range and puts the result in result. This can be compared with the semantics of the subtract operation of a set.

Calls C++ function: static void QItemSelection::split(const QItemSelectionRange& range, const QItemSelectionRange& other, QItemSelection* result).

C++ documentation:

Splits the selection range using the selection other range. Removes all items in other from range and puts the result in result. This can be compared with the semantics of the subtract operation of a set.

See also merge().

Methods from Deref<Target = QListOfQItemSelectionRange>

pub unsafe fn append_q_item_selection_range(
    &mut self,
    t: impl CastInto<Ref<QItemSelectionRange>>
)
[src]

Inserts value at the end of the list.

Calls C++ function: void QList<QItemSelectionRange>::append(const QItemSelectionRange& t).

C++ documentation:

Inserts value at the end of the list.

Example:

QList<QString> list; list.append("one"); list.append("two"); list.append("three"); // list: ["one", "two", "three"]

This is the same as list.insert(size(), value).

If this list is not shared, this operation is typically very fast (amortized constant time), because QList preallocates extra space on both sides of its internal buffer to allow for fast growth at both ends of the list.

See also operator<<(), prepend(), and insert().

pub unsafe fn append_q_list_of_q_item_selection_range(
    &mut self,
    t: impl CastInto<Ref<QListOfQItemSelectionRange>>
)
[src]

This is an overloaded function.

Calls C++ function: void QList<QItemSelectionRange>::append(const QList<QItemSelectionRange>& t).

C++ documentation:

This is an overloaded function.

Appends the items of the value list to this list.

This function was introduced in Qt 4.5.

See also operator<<() and operator+=().

pub unsafe fn at(&self, i: c_int) -> Ref<QItemSelectionRange>[src]

Returns the item at index position i in the list. i must be a valid index position in the list (i.e., 0 <= i < size()).

Calls C++ function: const QItemSelectionRange& QList<QItemSelectionRange>::at(int i) const.

C++ documentation:

Returns the item at index position i in the list. i must be a valid index position in the list (i.e., 0 <= i < size()).

This function is very fast (constant time).

See also value() and operator[]().

pub unsafe fn back_mut(&mut self) -> MutRef<QItemSelectionRange>[src]

This function is provided for STL compatibility. It is equivalent to last(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: QItemSelectionRange& QList<QItemSelectionRange>::back().

C++ documentation:

This function is provided for STL compatibility. It is equivalent to last(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

pub unsafe fn back(&self) -> Ref<QItemSelectionRange>[src]

This is an overloaded function.

Calls C++ function: const QItemSelectionRange& QList<QItemSelectionRange>::back() const.

C++ documentation:

This is an overloaded function.

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

Returns an STL-style iterator pointing to the first item in the list.

Calls C++ function: QList<QItemSelectionRange>::iterator QList<QItemSelectionRange>::begin().

C++ documentation:

Returns an STL-style iterator pointing to the first item in the list.

See also constBegin() and end().

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

This is an overloaded function.

Calls C++ function: QList<QItemSelectionRange>::const_iterator QList<QItemSelectionRange>::begin() const.

C++ documentation:

This is an overloaded function.

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

Returns a const STL-style iterator pointing to the first item in the list.

Calls C++ function: QList<QItemSelectionRange>::const_iterator QList<QItemSelectionRange>::cbegin() const.

C++ documentation:

Returns a const STL-style iterator pointing to the first item in the list.

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 list.

Calls C++ function: QList<QItemSelectionRange>::const_iterator QList<QItemSelectionRange>::cend() const.

C++ documentation:

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

This function was introduced in Qt 5.0.

See also cbegin() and end().

pub unsafe fn clear(&mut self)[src]

Removes all items from the list.

Calls C++ function: void QList<QItemSelectionRange>::clear().

C++ documentation:

Removes all items from the list.

See also removeAll().

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

Returns a const STL-style iterator pointing to the first item in the list.

Calls C++ function: QList<QItemSelectionRange>::const_iterator QList<QItemSelectionRange>::constBegin() const.

C++ documentation:

Returns a const STL-style iterator pointing to the first item in the list.

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 list.

Calls C++ function: QList<QItemSelectionRange>::const_iterator QList<QItemSelectionRange>::constEnd() const.

C++ documentation:

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

See also constBegin() and end().

pub unsafe fn const_first(&self) -> Ref<QItemSelectionRange>[src]

Returns a const reference to the first item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: const QItemSelectionRange& QList<QItemSelectionRange>::constFirst() const.

C++ documentation:

Returns a const reference to the first item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

This function was introduced in Qt 5.6.

See also constLast(), isEmpty(), and first().

pub unsafe fn const_last(&self) -> Ref<QItemSelectionRange>[src]

Returns a reference to the last item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: const QItemSelectionRange& QList<QItemSelectionRange>::constLast() const.

C++ documentation:

Returns a reference to the last item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

This function was introduced in Qt 5.6.

See also constFirst(), isEmpty(), and last().

pub unsafe fn contains(
    &self,
    t: impl CastInto<Ref<QItemSelectionRange>>
) -> bool
[src]

Returns true if the list contains an occurrence of value; otherwise returns false.

Calls C++ function: bool QList<QItemSelectionRange>::contains(const QItemSelectionRange& t) const.

C++ documentation:

Returns true if the list contains an occurrence of value; otherwise returns false.

This function requires the value type to have an implementation of operator==().

See also indexOf() and count().

pub unsafe fn copy_from(
    &mut self,
    l: impl CastInto<Ref<QListOfQItemSelectionRange>>
) -> MutRef<QListOfQItemSelectionRange>
[src]

Assigns other to this list and returns a reference to this list.

Calls C++ function: QList<QItemSelectionRange>& QList<QItemSelectionRange>::operator=(const QList<QItemSelectionRange>& l).

C++ documentation:

Assigns other to this list and returns a reference to this list.

pub unsafe fn count_1a(
    &self,
    t: impl CastInto<Ref<QItemSelectionRange>>
) -> c_int
[src]

Returns the number of occurrences of value in the list.

Calls C++ function: int QList<QItemSelectionRange>::count(const QItemSelectionRange& t) const.

C++ documentation:

Returns the number of occurrences of value in the list.

This function requires the value type to have an implementation of operator==().

See also contains() and indexOf().

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

Returns the number of items in the list. This is effectively the same as size().

Calls C++ function: int QList<QItemSelectionRange>::count() const.

C++ documentation:

Returns the number of items in the list. This is effectively the same as size().

pub unsafe fn detach(&mut self)[src]

Calls C++ function: void QList<QItemSelectionRange>::detach().

pub unsafe fn detach_shared(&mut self)[src]

Calls C++ function: void QList<QItemSelectionRange>::detachShared().

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

This function is provided for STL compatibility. It is equivalent to isEmpty() and returns true if the list is empty.

Calls C++ function: bool QList<QItemSelectionRange>::empty() const.

C++ documentation:

This function is provided for STL compatibility. It is equivalent to isEmpty() and returns true if the list is empty.

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

Returns an STL-style iterator pointing to the imaginary item after the last item in the list.

Calls C++ function: QList<QItemSelectionRange>::iterator QList<QItemSelectionRange>::end().

C++ documentation:

Returns an STL-style iterator pointing to the imaginary item after the last item in the list.

See also begin() and constEnd().

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

This is an overloaded function.

Calls C++ function: QList<QItemSelectionRange>::const_iterator QList<QItemSelectionRange>::end() const.

C++ documentation:

This is an overloaded function.

pub unsafe fn ends_with(
    &self,
    t: impl CastInto<Ref<QItemSelectionRange>>
) -> bool
[src]

Returns true if this list is not empty and its last item is equal to value; otherwise returns false.

Calls C++ function: bool QList<QItemSelectionRange>::endsWith(const QItemSelectionRange& t) const.

C++ documentation:

Returns true if this list is not empty and its last item is equal to value; otherwise returns false.

This function was introduced in Qt 4.5.

See also isEmpty() and contains().

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

Removes the item associated with the iterator pos from the list, and returns an iterator to the next item in the list (which may be end()).

Calls C++ function: QList<QItemSelectionRange>::iterator QList<QItemSelectionRange>::erase(QList<QItemSelectionRange>::iterator pos).

C++ documentation:

Removes the item associated with the iterator pos from the list, and returns an iterator to the next item in the list (which may be end()).

See also insert() and removeAt().

pub unsafe fn erase_2a(
    &mut self,
    first: impl CastInto<Ref<Iterator>>,
    last: impl CastInto<Ref<Iterator>>
) -> CppBox<Iterator>
[src]

This is an overloaded function.

Calls C++ function: QList<QItemSelectionRange>::iterator QList<QItemSelectionRange>::erase(QList<QItemSelectionRange>::iterator first, QList<QItemSelectionRange>::iterator last).

C++ documentation:

This is an overloaded function.

Removes all the items from begin up to (but not including) end. Returns an iterator to the same item that end referred to before the call.

pub unsafe fn first_mut(&mut self) -> MutRef<QItemSelectionRange>[src]

Returns a reference to the first item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: QItemSelectionRange& QList<QItemSelectionRange>::first().

C++ documentation:

Returns a reference to the first item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

See also constFirst(), last(), and isEmpty().

pub unsafe fn first(&self) -> Ref<QItemSelectionRange>[src]

This is an overloaded function.

Calls C++ function: const QItemSelectionRange& QList<QItemSelectionRange>::first() const.

C++ documentation:

This is an overloaded function.

pub unsafe fn front_mut(&mut self) -> MutRef<QItemSelectionRange>[src]

This function is provided for STL compatibility. It is equivalent to first(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: QItemSelectionRange& QList<QItemSelectionRange>::front().

C++ documentation:

This function is provided for STL compatibility. It is equivalent to first(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

pub unsafe fn front(&self) -> Ref<QItemSelectionRange>[src]

This is an overloaded function.

Calls C++ function: const QItemSelectionRange& QList<QItemSelectionRange>::front() const.

C++ documentation:

This is an overloaded function.

pub unsafe fn index(&self, i: c_int) -> Ref<QItemSelectionRange>[src]

This is an overloaded function.

Calls C++ function: const QItemSelectionRange& QList<QItemSelectionRange>::operator[](int i) const.

C++ documentation:

This is an overloaded function.

Same as at(). This function runs in constant time.

pub unsafe fn index_mut(&mut self, i: c_int) -> MutRef<QItemSelectionRange>[src]

Returns the item at index position i as a modifiable reference. i must be a valid index position in the list (i.e., 0 <= i < size()).

Calls C++ function: QItemSelectionRange& QList<QItemSelectionRange>::operator[](int i).

C++ documentation:

Returns the item at index position i as a modifiable reference. i must be a valid index position in the list (i.e., 0 <= i < size()).

If this function is called on a list that is currently being shared, it will trigger a copy of all elements. Otherwise, this function runs in constant time. If you do not want to modify the list you should use QList::at().

See also at() and value().

pub unsafe fn index_of_2a(
    &self,
    t: impl CastInto<Ref<QItemSelectionRange>>,
    from: c_int
) -> c_int
[src]

Returns the index position of the first occurrence of value in the list, searching forward from index position from. Returns -1 if no item matched.

Calls C++ function: int QList<QItemSelectionRange>::indexOf(const QItemSelectionRange& t, int from = …) const.

C++ documentation:

Returns the index position of the first occurrence of value in the list, searching forward from index position from. Returns -1 if no item matched.

Example:

QList<QString> list; list << "A" << "B" << "C" << "B" << "A"; list.indexOf("B"); // returns 1 list.indexOf("B", 1); // returns 1 list.indexOf("B", 2); // returns 3 list.indexOf("X"); // returns -1

This function requires the value type to have an implementation of operator==().

Note that QList uses 0-based indexes, just like C++ arrays. Negative indexes are not supported with the exception of the value mentioned above.

See also lastIndexOf() and contains().

pub unsafe fn index_of_1a(
    &self,
    t: impl CastInto<Ref<QItemSelectionRange>>
) -> c_int
[src]

Returns the index position of the first occurrence of value in the list, searching forward from index position from. Returns -1 if no item matched.

Calls C++ function: int QList<QItemSelectionRange>::indexOf(const QItemSelectionRange& t) const.

C++ documentation:

Returns the index position of the first occurrence of value in the list, searching forward from index position from. Returns -1 if no item matched.

Example:

QList<QString> list; list << "A" << "B" << "C" << "B" << "A"; list.indexOf("B"); // returns 1 list.indexOf("B", 1); // returns 1 list.indexOf("B", 2); // returns 3 list.indexOf("X"); // returns -1

This function requires the value type to have an implementation of operator==().

Note that QList uses 0-based indexes, just like C++ arrays. Negative indexes are not supported with the exception of the value mentioned above.

See also lastIndexOf() and contains().

pub unsafe fn insert_int_q_item_selection_range(
    &mut self,
    i: c_int,
    t: impl CastInto<Ref<QItemSelectionRange>>
)
[src]

Inserts value at index position i in the list. If i <= 0, the value is prepended to the list. If i >= size(), the value is appended to the list.

Calls C++ function: void QList<QItemSelectionRange>::insert(int i, const QItemSelectionRange& t).

C++ documentation:

Inserts value at index position i in the list. If i <= 0, the value is prepended to the list. If i >= size(), the value is appended to the list.

Example:

QList<QString> list; list << "alpha" << "beta" << "delta"; list.insert(2, "gamma"); // list: ["alpha", "beta", "gamma", "delta"]

See also append(), prepend(), replace(), and removeAt().

pub unsafe fn insert_iterator_q_item_selection_range(
    &mut self,
    before: impl CastInto<Ref<Iterator>>,
    t: impl CastInto<Ref<QItemSelectionRange>>
) -> CppBox<Iterator>
[src]

This is an overloaded function.

Calls C++ function: QList<QItemSelectionRange>::iterator QList<QItemSelectionRange>::insert(QList<QItemSelectionRange>::iterator before, const QItemSelectionRange& t).

C++ documentation:

This is an overloaded function.

Inserts value in front of the item pointed to by the iterator before. Returns an iterator pointing at the inserted item. Note that the iterator passed to the function will be invalid after the call; the returned iterator should be used instead.

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

Calls C++ function: bool QList<QItemSelectionRange>::isDetached() const.

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

Returns true if the list contains no items; otherwise returns false.

Calls C++ function: bool QList<QItemSelectionRange>::isEmpty() const.

C++ documentation:

Returns true if the list contains no items; otherwise returns false.

See also size().

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

Calls C++ function: bool QList<QItemSelectionRange>::isSharedWith(const QList<QItemSelectionRange>& other) const.

pub unsafe fn last_mut(&mut self) -> MutRef<QItemSelectionRange>[src]

Returns a reference to the last item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: QItemSelectionRange& QList<QItemSelectionRange>::last().

C++ documentation:

Returns a reference to the last item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

See also constLast(), first(), and isEmpty().

pub unsafe fn last(&self) -> Ref<QItemSelectionRange>[src]

This is an overloaded function.

Calls C++ function: const QItemSelectionRange& QList<QItemSelectionRange>::last() const.

C++ documentation:

This is an overloaded function.

pub unsafe fn last_index_of_2a(
    &self,
    t: impl CastInto<Ref<QItemSelectionRange>>,
    from: c_int
) -> c_int
[src]

Returns the index position of the last occurrence of value in the list, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.

Calls C++ function: int QList<QItemSelectionRange>::lastIndexOf(const QItemSelectionRange& t, int from = …) const.

C++ documentation:

Returns the index position of the last occurrence of value in the list, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.

Example:

QList<QString> list; list << "A" << "B" << "C" << "B" << "A"; list.lastIndexOf("B"); // returns 3 list.lastIndexOf("B", 3); // returns 3 list.lastIndexOf("B", 2); // returns 1 list.lastIndexOf("X"); // returns -1

This function requires the value type to have an implementation of operator==().

Note that QList uses 0-based indexes, just like C++ arrays. Negative indexes are not supported with the exception of the value mentioned above.

See also indexOf().

pub unsafe fn last_index_of_1a(
    &self,
    t: impl CastInto<Ref<QItemSelectionRange>>
) -> c_int
[src]

Returns the index position of the last occurrence of value in the list, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.

Calls C++ function: int QList<QItemSelectionRange>::lastIndexOf(const QItemSelectionRange& t) const.

C++ documentation:

Returns the index position of the last occurrence of value in the list, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.

Example:

QList<QString> list; list << "A" << "B" << "C" << "B" << "A"; list.lastIndexOf("B"); // returns 3 list.lastIndexOf("B", 3); // returns 3 list.lastIndexOf("B", 2); // returns 1 list.lastIndexOf("X"); // returns -1

This function requires the value type to have an implementation of operator==().

Note that QList uses 0-based indexes, just like C++ arrays. Negative indexes are not supported with the exception of the value mentioned above.

See also indexOf().

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

This function is identical to count().

Calls C++ function: int QList<QItemSelectionRange>::length() const.

C++ documentation:

This function is identical to count().

This function was introduced in Qt 4.5.

See also count().

pub unsafe fn mid_2a(
    &self,
    pos: c_int,
    length: c_int
) -> CppBox<QListOfQItemSelectionRange>
[src]

Returns a sub-list which includes elements from this list, starting at position pos. If length is -1 (the default), all elements from pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.

Calls C++ function: QList<QItemSelectionRange> QList<QItemSelectionRange>::mid(int pos, int length = …) const.

C++ documentation:

Returns a sub-list which includes elements from this list, starting at position pos. If length is -1 (the default), all elements from pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.

pub unsafe fn mid_1a(&self, pos: c_int) -> CppBox<QListOfQItemSelectionRange>[src]

Returns a sub-list which includes elements from this list, starting at position pos. If length is -1 (the default), all elements from pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.

Calls C++ function: QList<QItemSelectionRange> QList<QItemSelectionRange>::mid(int pos) const.

C++ documentation:

Returns a sub-list which includes elements from this list, starting at position pos. If length is -1 (the default), all elements from pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.

pub unsafe fn move_(&mut self, from: c_int, to: c_int)[src]

Moves the item at index position from to index position to.

Calls C++ function: void QList<QItemSelectionRange>::move(int from, int to).

C++ documentation:

Moves the item at index position from to index position to.

Example:

QList<QString> list; list << "A" << "B" << "C" << "D" << "E" << "F"; list.move(1, 4); // list: ["A", "C", "D", "E", "B", "F"]

This is the same as insert(to, takeAt(from)).This function assumes that both from and to are at least 0 but less than size(). To avoid failure, test that both from and to are at least 0 and less than size().

See also swap(), insert(), and takeAt().

pub unsafe fn pop_back(&mut self)[src]

This function is provided for STL compatibility. It is equivalent to removeLast(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: void QList<QItemSelectionRange>::pop_back().

C++ documentation:

This function is provided for STL compatibility. It is equivalent to removeLast(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

pub unsafe fn pop_front(&mut self)[src]

This function is provided for STL compatibility. It is equivalent to removeFirst(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: void QList<QItemSelectionRange>::pop_front().

C++ documentation:

This function is provided for STL compatibility. It is equivalent to removeFirst(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

pub unsafe fn prepend(&mut self, t: impl CastInto<Ref<QItemSelectionRange>>)[src]

Inserts value at the beginning of the list.

Calls C++ function: void QList<QItemSelectionRange>::prepend(const QItemSelectionRange& t).

C++ documentation:

Inserts value at the beginning of the list.

Example:

QList<QString> list; list.prepend("one"); list.prepend("two"); list.prepend("three"); // list: ["three", "two", "one"]

This is the same as list.insert(0, value).

If this list is not shared, this operation is typically very fast (amortized constant time), because QList preallocates extra space on both sides of its internal buffer to allow for fast growth at both ends of the list.

See also append() and insert().

pub unsafe fn push_back(&mut self, t: impl CastInto<Ref<QItemSelectionRange>>)[src]

This function is provided for STL compatibility. It is equivalent to append(value).

Calls C++ function: void QList<QItemSelectionRange>::push_back(const QItemSelectionRange& t).

C++ documentation:

This function is provided for STL compatibility. It is equivalent to append(value).

pub unsafe fn push_front(&mut self, t: impl CastInto<Ref<QItemSelectionRange>>)[src]

This function is provided for STL compatibility. It is equivalent to prepend(value).

Calls C++ function: void QList<QItemSelectionRange>::push_front(const QItemSelectionRange& t).

C++ documentation:

This function is provided for STL compatibility. It is equivalent to prepend(value).

pub unsafe fn remove_all(
    &mut self,
    t: impl CastInto<Ref<QItemSelectionRange>>
) -> c_int
[src]

Removes all occurrences of value in the list and returns the number of entries removed.

Calls C++ function: int QList<QItemSelectionRange>::removeAll(const QItemSelectionRange& t).

C++ documentation:

Removes all occurrences of value in the list and returns the number of entries removed.

Example:

QList<QString> list; list << "sun" << "cloud" << "sun" << "rain"; list.removeAll("sun"); // list: ["cloud", "rain"]

This function requires the value type to have an implementation of operator==().

See also removeOne(), removeAt(), takeAt(), and replace().

pub unsafe fn remove_at(&mut self, i: c_int)[src]

Removes the item at index position i. i must be a valid index position in the list (i.e., 0 <= i < size()).

Calls C++ function: void QList<QItemSelectionRange>::removeAt(int i).

C++ documentation:

Removes the item at index position i. i must be a valid index position in the list (i.e., 0 <= i < size()).

See also takeAt(), removeFirst(), removeLast(), and removeOne().

pub unsafe fn remove_first(&mut self)[src]

Removes the first item in the list. Calling this function is equivalent to calling removeAt(0). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: void QList<QItemSelectionRange>::removeFirst().

C++ documentation:

Removes the first item in the list. Calling this function is equivalent to calling removeAt(0). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

See also removeAt() and takeFirst().

pub unsafe fn remove_last(&mut self)[src]

Removes the last item in the list. Calling this function is equivalent to calling removeAt(size() - 1). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

Calls C++ function: void QList<QItemSelectionRange>::removeLast().

C++ documentation:

Removes the last item in the list. Calling this function is equivalent to calling removeAt(size() - 1). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.

See also removeAt() and takeLast().

pub unsafe fn remove_one(
    &mut self,
    t: impl CastInto<Ref<QItemSelectionRange>>
) -> bool
[src]

Removes the first occurrence of value in the list and returns true on success; otherwise returns false.

Calls C++ function: bool QList<QItemSelectionRange>::removeOne(const QItemSelectionRange& t).

C++ documentation:

Removes the first occurrence of value in the list and returns true on success; otherwise returns false.

Example:

QList<QString> list; list << "sun" << "cloud" << "sun" << "rain"; list.removeOne("sun"); // list: ["cloud", ,"sun", "rain"]

This function requires the value type to have an implementation of operator==().

This function was introduced in Qt 4.4.

See also removeAll(), removeAt(), takeAt(), and replace().

pub unsafe fn replace(
    &mut self,
    i: c_int,
    t: impl CastInto<Ref<QItemSelectionRange>>
)
[src]

Replaces the item at index position i with value. i must be a valid index position in the list (i.e., 0 <= i < size()).

Calls C++ function: void QList<QItemSelectionRange>::replace(int i, const QItemSelectionRange& t).

C++ documentation:

Replaces the item at index position i with value. i must be a valid index position in the list (i.e., 0 <= i < size()).

See also operator[]() and removeAt().

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

Reserve space for alloc elements.

Calls C++ function: void QList<QItemSelectionRange>::reserve(int size).

C++ documentation:

Reserve space for alloc elements.

If alloc is smaller than the current size of the list, nothing will happen.

Use this function to avoid repetetive reallocation of QList's internal data if you can predict how many elements will be appended. Note that the reservation applies only to the internal pointer array.

This function was introduced in Qt 4.7.

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

Calls C++ function: void QList<QItemSelectionRange>::setSharable(bool sharable).

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

Returns the number of items in the list.

Calls C++ function: int QList<QItemSelectionRange>::size() const.

C++ documentation:

Returns the number of items in the list.

See also isEmpty() and count().

pub unsafe fn starts_with(
    &self,
    t: impl CastInto<Ref<QItemSelectionRange>>
) -> bool
[src]

Returns true if this list is not empty and its first item is equal to value; otherwise returns false.

Calls C++ function: bool QList<QItemSelectionRange>::startsWith(const QItemSelectionRange& t) const.

C++ documentation:

Returns true if this list is not empty and its first item is equal to value; otherwise returns false.

This function was introduced in Qt 4.5.

See also isEmpty() and contains().

pub unsafe fn swap_1a(
    &mut self,
    other: impl CastInto<MutRef<QListOfQItemSelectionRange>>
)
[src]

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

Calls C++ function: void QList<QItemSelectionRange>::swap(QList<QItemSelectionRange>& other).

C++ documentation:

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

This function was introduced in Qt 4.8.

pub unsafe fn swap_2a(&mut self, i: c_int, j: c_int)[src]

Exchange the item at index position i with the item at index position j. This function assumes that both i and j are at least 0 but less than size(). To avoid failure, test that both i and j are at least 0 and less than size().

Calls C++ function: void QList<QItemSelectionRange>::swap(int i, int j).

C++ documentation:

Exchange the item at index position i with the item at index position j. This function assumes that both i and j are at least 0 but less than size(). To avoid failure, test that both i and j are at least 0 and less than size().

Example:

QList<QString> list; list << "A" << "B" << "C" << "D" << "E" << "F"; list.swap(1, 4); // list: ["A", "E", "C", "D", "B", "F"]

See also move().

pub unsafe fn take_at(&mut self, i: c_int) -> CppBox<QItemSelectionRange>[src]

Removes the item at index position i and returns it. i must be a valid index position in the list (i.e., 0 <= i < size()).

Calls C++ function: QItemSelectionRange QList<QItemSelectionRange>::takeAt(int i).

C++ documentation:

Removes the item at index position i and returns it. i must be a valid index position in the list (i.e., 0 <= i < size()).

If you don't use the return value, removeAt() is more efficient.

See also removeAt(), takeFirst(), and takeLast().

pub unsafe fn take_first(&mut self) -> CppBox<QItemSelectionRange>[src]

Removes the first item in the list and returns it. This is the same as takeAt(0). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function.

Calls C++ function: QItemSelectionRange QList<QItemSelectionRange>::takeFirst().

C++ documentation:

Removes the first item in the list and returns it. This is the same as takeAt(0). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function.

If this list is not shared, this operation takes constant time.

If you don't use the return value, removeFirst() is more efficient.

See also takeLast(), takeAt(), and removeFirst().

pub unsafe fn take_last(&mut self) -> CppBox<QItemSelectionRange>[src]

Removes the last item in the list and returns it. This is the same as takeAt(size() - 1). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function.

Calls C++ function: QItemSelectionRange QList<QItemSelectionRange>::takeLast().

C++ documentation:

Removes the last item in the list and returns it. This is the same as takeAt(size() - 1). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function.

If this list is not shared, this operation takes constant time.

If you don't use the return value, removeLast() is more efficient.

See also takeFirst(), takeAt(), and removeLast().

pub unsafe fn value_1a(&self, i: c_int) -> CppBox<QItemSelectionRange>[src]

Returns the value at index position i in the list.

Calls C++ function: QItemSelectionRange QList<QItemSelectionRange>::value(int i) const.

C++ documentation:

Returns the value at index position i in the list.

If the index i is out of bounds, the function returns a default-constructed value. If you are certain that the index is going to be within bounds, you can use at() instead, which is slightly faster.

See also at() and operator[]().

pub unsafe fn value_2a(
    &self,
    i: c_int,
    default_value: impl CastInto<Ref<QItemSelectionRange>>
) -> CppBox<QItemSelectionRange>
[src]

This is an overloaded function.

Calls C++ function: QItemSelectionRange QList<QItemSelectionRange>::value(int i, const QItemSelectionRange& defaultValue) const.

C++ documentation:

This is an overloaded function.

If the index i is out of bounds, the function returns defaultValue.

Trait Implementations

impl Deref for QItemSelection[src]

type Target = QListOfQItemSelectionRange

The resulting type after dereferencing.

fn deref(&self) -> &QListOfQItemSelectionRange[src]

Calls C++ function: QList<QItemSelectionRange>* static_cast<QList<QItemSelectionRange>*>(QItemSelection* ptr).

impl DerefMut for QItemSelection[src]

fn deref_mut(&mut self) -> &mut QListOfQItemSelectionRange[src]

Calls C++ function: QList<QItemSelectionRange>* static_cast<QList<QItemSelectionRange>*>(QItemSelection* ptr).

impl StaticUpcast<QListOfQItemSelectionRange> for QItemSelection[src]

unsafe fn static_upcast(
    ptr: Ptr<QItemSelection>
) -> Ptr<QListOfQItemSelectionRange>
[src]

Calls C++ function: QList<QItemSelectionRange>* static_cast<QList<QItemSelectionRange>*>(QItemSelection* ptr).

unsafe fn static_upcast_mut(
    ptr: MutPtr<QItemSelection>
) -> MutPtr<QListOfQItemSelectionRange>
[src]

Calls C++ function: QList<QItemSelectionRange>* static_cast<QList<QItemSelectionRange>*>(QItemSelection* ptr).

impl StaticDowncast<QItemSelection> for QListOfQItemSelectionRange[src]

unsafe fn static_downcast(
    ptr: Ptr<QListOfQItemSelectionRange>
) -> Ptr<QItemSelection>
[src]

Calls C++ function: QItemSelection* static_cast<QItemSelection*>(QList<QItemSelectionRange>* ptr).

unsafe fn static_downcast_mut(
    ptr: MutPtr<QListOfQItemSelectionRange>
) -> MutPtr<QItemSelection>
[src]

Calls C++ function: QItemSelection* static_cast<QItemSelection*>(QList<QItemSelectionRange>* ptr).

impl CppDeletable for QItemSelection[src]

unsafe fn delete(&mut self)[src]

The QItemSelection class manages information about selected items in a model.

Calls C++ function: [destructor] void QItemSelection::~QItemSelection().

C++ documentation:

The QItemSelection class manages information about selected items in a model.

A QItemSelection describes the items in a model that have been selected by the user. A QItemSelection is basically a list of selection ranges, see QItemSelectionRange. It provides functions for creating and manipulating selections, and selecting a range of items from a model.

The QItemSelection class is one of the Model/View Classes and is part of Qt's model/view framework.

An item selection can be constructed and initialized to contain a range of items from an existing model. The following example constructs a selection that contains a range of items from the given model, beginning at the topLeft, and ending at the bottomRight.

QItemSelection *selection = new QItemSelection(topLeft, bottomRight);

An empty item selection can be constructed, and later populated as required. So, if the model is going to be unavailable when we construct the item selection, we can rewrite the above code in the following way:

QItemSelection *selection = new QItemSelection(); ... selection->select(topLeft, bottomRight);

QItemSelection saves memory, and avoids unnecessary work, by working with selection ranges rather than recording the model item index for each item in the selection. Generally, an instance of this class will contain a list of non-overlapping selection ranges.

Use merge() to merge one item selection into another without making overlapping ranges. Use split() to split one selection range into smaller ranges based on a another selection range.

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<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.

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

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

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

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

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