pub struct TableView { /* private fields */ }Expand description
A QTableView bound to a StringTableModel.
Implementations§
Source§impl TableView
impl TableView
Sourcepub fn set_visible(&self, visible: bool)
pub fn set_visible(&self, visible: bool)
Show or hide the table without dropping its model or selection state.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Whether the table is currently visible on screen.
Sourcepub fn header_clicked(&self) -> EventStream<usize>
pub fn header_clicked(&self) -> EventStream<usize>
A stream of header clicks, each carrying the clicked column index. Use it to implement click-to-sort columns.
Sourcepub fn click_header(&self, section: usize)
pub fn click_header(&self, section: usize)
Simulate a click on the column header section (used by tests and
headless smoke runs).
A stream of right-click (context menu) events on table rows, each carrying the row under the cursor.
Simulate a right-click on row (used by tests and headless smoke
runs); the shim shows the context menu and reports the row.
Sourcepub fn set_column_width(&self, column: usize, width: i32)
pub fn set_column_width(&self, column: usize, width: i32)
Set the pixel width of column.
Hide or show column without changing the model layout.
Sourcepub fn set_sort_indicator(&self, column: usize, ascending: bool)
pub fn set_sort_indicator(&self, column: usize, ascending: bool)
Show the sort arrow on column in the given direction.
Sourcepub fn bind_sort_indicator(&self, signal: &Signal<(usize, bool)>)
pub fn bind_sort_indicator(&self, signal: &Signal<(usize, bool)>)
Keep the sort arrow in sync with a signal of (column, ascending),
so sorting state stays declarative instead of imperative.
Sourcepub fn stretch_last_section(&self, stretch: bool)
pub fn stretch_last_section(&self, stretch: bool)
Let the last column fill the remaining view width.
Sourcepub fn select_rows(&self, on: bool)
pub fn select_rows(&self, on: bool)
Select whole rows instead of individual cells.
Sourcepub fn enable_heat(&self)
pub fn enable_heat(&self)
Install the heat-map delegate so cells with heat values render with an intensity wash.
Sourcepub fn selection_changed(&self) -> EventStream<Vec<usize>>
pub fn selection_changed(&self) -> EventStream<Vec<usize>>
A stream of selection changes, each carrying the selected row indices.
Sourcepub fn on_selection<F>(&self, f: F) -> &Self
pub fn on_selection<F>(&self, f: F) -> &Self
Register a selection handler carrying the selected row indices.
Sourcepub fn clear_selection(&self)
pub fn clear_selection(&self)
Clear the selection.
Sourcepub fn selected_rows(&self) -> Vec<usize>
pub fn selected_rows(&self) -> Vec<usize>
The currently selected row indices.
Sourcepub fn qobject_ptr(&self) -> *mut Void
pub fn qobject_ptr(&self) -> *mut Void
Escape hatch: the underlying Qt QTableView pointer.
The pointer is valid only while this view’s Qt object is alive. Do not retain it after destruction or use it from a thread other than the GUI thread. Dereferencing or passing the pointer across FFI remains unsafe.