pub struct TreeView { /* private fields */ }Expand description
A QTreeView bound to a TreeModel.
Implementations§
Source§impl TreeView
impl TreeView
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Whether the tree is currently visible on screen.
Sourcepub fn selection_changed(&self) -> EventStream<Vec<usize>>
pub fn selection_changed(&self) -> EventStream<Vec<usize>>
A stream of selection changes carrying the selected flat 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 flat row indices.
Sourcepub fn selected_rows(&self) -> Vec<usize>
pub fn selected_rows(&self) -> Vec<usize>
The currently selected flat row indices.
Sourcepub fn header_clicked(&self) -> EventStream<usize>
pub fn header_clicked(&self) -> EventStream<usize>
A stream of header clicks carrying the clicked column index.
Sourcepub fn click_header(&self, section: usize)
pub fn click_header(&self, section: usize)
Simulate a header click (used by tests and smoke runs).
A stream of right-click events carrying the flat row under the cursor.
Simulate a right-click on flat row row (used by tests and smokes).
Sourcepub fn scroll_value(&self) -> i32
pub fn scroll_value(&self) -> i32
The current vertical scroll position in pixels.
Sourcepub fn set_scroll_value(&self, value: i32)
pub fn set_scroll_value(&self, value: i32)
Restore the vertical scroll position in pixels.
Sourcepub fn expand_all(&self, expand: bool)
pub fn expand_all(&self, expand: bool)
Expand or collapse all group rows.
Sourcepub fn expanded_rows(&self) -> Vec<usize>
pub fn expanded_rows(&self) -> Vec<usize>
Flat rows that are currently expanded.
Sourcepub fn expand_rows(&self, rows: &[usize])
pub fn expand_rows(&self, rows: &[usize])
Expand the given flat rows.
Sourcepub fn top_row(&self) -> Option<usize>
pub fn top_row(&self) -> Option<usize>
The flat row currently scrolled to the top of the viewport, if any.
Sourcepub fn scroll_to_flat(&self, flat: usize)
pub fn scroll_to_flat(&self, flat: usize)
Scroll the viewport so flat is at the top.
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 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.