pub struct StringTableModel { /* private fields */ }Expand description
A string table model that drives a Qt QTableView incrementally.
Rows are Vec<String>; changes are applied to the C++ QAbstractTableModel
with beginInsertRows/beginRemoveRows/dataChanged.
Implementations§
Source§impl StringTableModel
impl StringTableModel
Sourcepub fn new(columns: usize, headers: impl IntoIterator<Item = String>) -> Self
pub fn new(columns: usize, headers: impl IntoIterator<Item = String>) -> Self
Create a table with columns columns and the given header labels.
Sourcepub fn bind_rows(&self, signal: &Signal<Vec<Vec<String>>>)
pub fn bind_rows(&self, signal: &Signal<Vec<Vec<String>>>)
Bind the table’s rows to a signal: every emission replaces all rows. The subscription lives as long as the model.
Sourcepub fn set_headers(&self, headers: impl IntoIterator<Item = String>)
pub fn set_headers(&self, headers: impl IntoIterator<Item = String>)
Replace the column headers.
Sourcepub fn bind_headers(&self, signal: &Signal<Vec<String>>)
pub fn bind_headers(&self, signal: &Signal<Vec<String>>)
Bind the column headers to a signal.
Sourcepub fn set_row_icons(&self, paths: impl IntoIterator<Item = String>)
pub fn set_row_icons(&self, paths: impl IntoIterator<Item = String>)
Set a per-row icon for column 0, given the file path whose icon should be shown (e.g. an executable). Empty paths show no icon.
Sourcepub fn bind_row_icons(&self, signal: &Signal<Vec<String>>)
pub fn bind_row_icons(&self, signal: &Signal<Vec<String>>)
Bind per-row icons (file paths whose icon appears in column 0) to a signal. The subscription lives as long as the model.
Sourcepub fn set_heat(&self, column: usize, values: impl IntoIterator<Item = f64>)
pub fn set_heat(&self, column: usize, values: impl IntoIterator<Item = f64>)
Set normalized (0..1) heat values for column, rendered as a
translucent intensity wash by the view’s heat delegate.
Sourcepub fn bind_heat(&self, column: usize, signal: &Signal<Vec<f64>>)
pub fn bind_heat(&self, column: usize, signal: &Signal<Vec<f64>>)
Bind normalized heat values for column to a signal.
Sourcepub fn bind_table(&self, signal: &Signal<Vec<(Vec<String>, String)>>)
pub fn bind_table(&self, signal: &Signal<Vec<(Vec<String>, String)>>)
Bind rows and their column-0 icons from one signal of
(cells, icon path) pairs. Rows and icons are applied atomically in a
single observer, so a row reset can never wipe the same-pass icons.
Sourcepub fn row_icon_count(&self) -> usize
pub fn row_icon_count(&self) -> usize
Number of rows with a non-null icon in column 0.
Sourcepub fn set_column_alignment(&self, column: usize, align: TextAlign)
pub fn set_column_alignment(&self, column: usize, align: TextAlign)
Set the horizontal alignment of column.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Number of columns.
Sourcepub fn cell(&self, row: usize, column: usize) -> String
pub fn cell(&self, row: usize, column: usize) -> String
The cell text at (row, column) as stored in the C++ mirror.
Sourcepub fn push_row(&self, row: impl IntoIterator<Item = String>)
pub fn push_row(&self, row: impl IntoIterator<Item = String>)
Append a row.
Sourcepub fn insert_row(&self, index: usize, row: impl IntoIterator<Item = String>)
pub fn insert_row(&self, index: usize, row: impl IntoIterator<Item = String>)
Insert a row at index.
Sourcepub fn remove_row(&self, index: usize) -> bool
pub fn remove_row(&self, index: usize) -> bool
Remove the row at index.
Sourcepub fn set_row(
&self,
index: usize,
row: impl IntoIterator<Item = String>,
) -> bool
pub fn set_row( &self, index: usize, row: impl IntoIterator<Item = String>, ) -> bool
Replace the row at index.
Sourcepub fn replace_all(&self, rows: impl IntoIterator<Item = Vec<String>>)
pub fn replace_all(&self, rows: impl IntoIterator<Item = Vec<String>>)
Replace the whole table.