Struct cxx_qt_lib::QList
source · #[repr(C)]pub struct QList<T>where
T: QListElement,{ /* private fields */ }
Expand description
The QList class is a template class that provides a dynamic array.
To use QList with a custom type, implement the QListElement
trait for T.
Implementations§
source§impl QList<QByteArray>
impl QList<QByteArray>
pub fn cxx_contains(&self, arg0: &QByteArray) -> bool
source§impl QList<QPersistentModelIndex>
impl QList<QPersistentModelIndex>
pub fn cxx_contains(&self, arg0: &QPersistentModelIndex) -> bool
source§impl<T> QList<T>where
T: QListElement,
impl<T> QList<T>where
T: QListElement,
sourcepub fn append_clone(&mut self, value: &T)
pub fn append_clone(&mut self, value: &T)
Inserts value at the end of the list.
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 list.
sourcepub fn contains(&self, value: &T) -> bool
pub fn contains(&self, value: &T) -> bool
Returns true if the list 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 list.
index must be a valid position in the list (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 list, 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 list 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 list.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the list contains no elements; otherwise returns false.
Trait Implementations§
source§impl<T> Clone for QList<T>where
T: QListElement,
impl<T> Clone for QList<T>where
T: QListElement,
source§impl<T> Default for QList<T>where
T: QListElement,
impl<T> Default for QList<T>where
T: QListElement,
source§impl<T> ExternType for QList<T>where
T: ExternType + QListElement,
impl<T> ExternType for QList<T>where
T: ExternType + QListElement,
source§impl From<&QStringList> for QList<QString>
impl From<&QStringList> for QList<QString>
source§fn from(list: &QStringList) -> Self
fn from(list: &QStringList) -> Self
Converts a QStringList into a QList<QString>