Struct qml::QListModel
[−]
[src]
pub struct QListModel<'a> { /* fields omitted */ }
Allows providing a custom model to QML
Methods
impl<'a> QListModel<'a>
[src]
fn new<'b>(rolenames: &'b [&'a str]) -> Box<Self>
Rolenames are roles of provided data, that are mapped to corresponding roles in QML.
fn row_count(&self) -> usize
Returns an amount of rows in this model
fn get_qvar(&self) -> QVariant
Gets a QVariant
associate
fn append_row<T>(&mut self, qvars: T) where T: Iterator<Item=QVariant>
Appends a row to the model
Note that it clones all incoming qvariants as modifying them is not allowed.
fn insert_row<T>(&mut self, index: usize, qvars: T) where T: Iterator<Item=QVariant>
Inserts a row into model
Note that it clones all incoming qvariants as modifying them is not allowed.
fn remove_row(&mut self, index: usize)
Remove a line from the model.
fn set_data(&mut self, qvars: Vec<Vec<QVariant>>)
Sets a data for this QAbstractListModel
fn change_line(&mut self, index: usize, qvars: Vec<QVariant>)
Changes a line in underlying data
fn clear(&mut self)
Clear all the data from the model
fn view_data(&self) -> &[Vec<QVariant>]
Gets an immutable view of the data