Skip to main content

TreeView

Struct TreeView 

Source
pub struct TreeView { /* private fields */ }
Expand description

A QTreeView bound to a TreeModel.

Implementations§

Source§

impl TreeView

Source

pub fn is_visible(&self) -> bool

Whether the tree is currently visible on screen.

Source

pub fn width(&self) -> i32

The tree’s current width in pixels.

Source

pub fn height(&self) -> i32

The tree’s current height in pixels.

Source

pub fn selection_changed(&self) -> EventStream<Vec<usize>>

A stream of selection changes carrying the selected flat row indices.

Source

pub fn on_selection<F>(&self, f: F) -> &Self
where F: FnMut(&Vec<usize>) + 'static,

Register a selection handler carrying the selected flat row indices.

Source

pub fn select(&self, row: usize)

Select the flat row row, expanding its ancestors.

Source

pub fn selected_rows(&self) -> Vec<usize>

The currently selected flat row indices.

Source

pub fn header_clicked(&self) -> EventStream<usize>

A stream of header clicks carrying the clicked column index.

Source

pub fn click_header(&self, section: usize)

Simulate a header click (used by tests and smoke runs).

Source

pub fn context_menu(&self) -> EventStream<usize>

A stream of right-click events carrying the flat row under the cursor.

Source

pub fn emit_context_menu(&self, row: usize)

Simulate a right-click on flat row row (used by tests and smokes).

Source

pub fn scroll_value(&self) -> i32

The current vertical scroll position in pixels.

Source

pub fn set_scroll_value(&self, value: i32)

Restore the vertical scroll position in pixels.

Source

pub fn expand_all(&self, expand: bool)

Expand or collapse all group rows.

Source

pub fn expanded_rows(&self) -> Vec<usize>

Flat rows that are currently expanded.

Source

pub fn expand_rows(&self, rows: &[usize])

Expand the given flat rows.

Source

pub fn top_row(&self) -> Option<usize>

The flat row currently scrolled to the top of the viewport, if any.

Source

pub fn scroll_to_flat(&self, flat: usize)

Scroll the viewport so flat is at the top.

Source

pub fn set_column_width(&self, column: usize, width: i32)

Set the pixel width of column.

Source

pub fn set_column_hidden(&self, column: usize, hidden: bool)

Hide or show column without changing the model layout.

Source

pub fn set_sort_indicator(&self, column: usize, ascending: bool)

Show the sort arrow on column in the given direction.

Source

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.

Source

pub fn stretch_last_section(&self, stretch: bool)

Let the last column fill the remaining width.

Source

pub fn select_rows(&self, on: bool)

Select whole rows instead of individual cells.

Source

pub fn enable_heat(&self)

Install the heat-map delegate.

Trait Implementations§

Source§

impl Clone for TreeView

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl IntoWidget for TreeView

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.