Struct cxx_qt_lib::QVector
source · #[repr(C)]pub struct QVector<T>where
T: QVectorElement,{ /* private fields */ }
Expand description
The QVector class is a template class that provides a dynamic array.
To use QVector with a custom type, implement the QVectorElement
trait for T.
Implementations§
source§impl QVector<QByteArray>
impl QVector<QByteArray>
pub fn cxx_contains(&self, arg0: &QByteArray) -> bool
source§impl QVector<QPersistentModelIndex>
impl QVector<QPersistentModelIndex>
pub fn cxx_contains(&self, arg0: &QPersistentModelIndex) -> bool
source§impl<T> QVector<T>where
T: QVectorElement,
impl<T> QVector<T>where
T: QVectorElement,
sourcepub fn append_clone(&mut self, value: &T)
pub fn append_clone(&mut self, value: &T)
Inserts value at the end of the vector.
The value is a reference here so it can be opaque or trivial but note that the value is copied when being appended into the vector.
sourcepub fn contains(&self, value: &T) -> bool
pub fn contains(&self, value: &T) -> bool
Returns true if the vector contains item value; otherwise returns false.
sourcepub fn get(&self, index: isize) -> Option<&T>
pub fn get(&self, index: isize) -> Option<&T>
Returns the item at index position in the vector.
index must be a valid position in the vector (i.e., 0 <= index < len()).
sourcepub fn index_of(&self, value: &T) -> isize
pub fn index_of(&self, value: &T) -> isize
Returns the index position of the first occurrence of value in the vector, searching forward from index position from. Returns -1 if no item matched.
sourcepub fn insert_clone(&mut self, pos: isize, value: &T)
pub fn insert_clone(&mut self, pos: isize, value: &T)
Inserts item value into the vector at the given position.
The value is a reference here so it can be opaque or trivial but note that the value is copied when being inserted into the vector.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the vector contains no elements; otherwise returns false.
sourcepub fn iter(&self) -> Iter<'_, T>
pub fn iter(&self) -> Iter<'_, T>
An iterator visiting all elements in arbitrary order. The iterator element type is &’a T.