Skip to main content

TableView

Struct TableView 

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

A QTableView bound to a StringTableModel.

Implementations§

Source§

impl TableView

Source

pub fn set_visible(&self, visible: bool)

Show or hide the table without dropping its model or selection state.

Source

pub fn is_visible(&self) -> bool

Whether the table is currently visible on screen.

Source

pub fn width(&self) -> i32

The table’s current width in pixels.

Source

pub fn height(&self) -> i32

The table’s current height in pixels.

Source

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.

Source

pub fn click_header(&self, section: usize)

Simulate a click on the column header section (used by tests and headless smoke runs).

Source

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

A stream of right-click (context menu) events on table rows, each carrying the row under the cursor.

Source

pub fn emit_context_menu(&self, row: usize)

Simulate a right-click on row (used by tests and headless smoke runs); the shim shows the context menu and reports the row.

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 view 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 so cells with heat values render with an intensity wash.

Source

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

A stream of selection changes, each carrying the selected 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 row indices.

Source

pub fn select(&self, row: usize)

Select row, replacing the current selection.

Source

pub fn clear_selection(&self)

Clear the selection.

Source

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

The currently selected row indices.

Source

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.

Trait Implementations§

Source§

impl Clone for TableView

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 TableView

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.