Data model for TableListBox — implement this to provide row data.
More...
#include <table.hpp>
Data model for TableListBox — implement this to provide row data.
◆ ~TableModel()
| virtual pulp::view::TableModel::~TableModel |
( |
| ) |
|
|
virtualdefault |
◆ add_column()
| void pulp::view::TableModel::add_column |
( |
TableColumn | column | ) |
|
|
inline |
◆ add_row()
| void pulp::view::TableModel::add_row |
( |
std::vector< TableCell > | cells | ) |
|
|
inline |
Add a row.
Pads with empty cells if short.
If a previous sort was active, sort state is dropped but the insertion-order mapping is restored first so a later clear_sort() can still return rows to their original order. This matches the clear_sort contract documented above; without the restore step a dynamic table that receives new rows after sorting would get stuck at the post-sort layout. Fix per #200 review.
◆ cell()
| const TableCell & pulp::view::TableModel::cell |
( |
std::size_t | row, |
|
|
std::size_t | col ) const |
|
inline |
◆ cell_text()
| virtual std::string pulp::view::TableModel::cell_text |
( |
int | row, |
|
|
int | column ) const |
|
pure virtual |
◆ clear_sort()
| void pulp::view::TableModel::clear_sort |
( |
| ) |
|
|
inline |
Clear any sort; original insertion order is restored.
◆ column()
| const TableColumn & pulp::view::TableModel::column |
( |
std::size_t | i | ) |
const |
|
inline |
◆ column_count()
| std::size_t pulp::view::TableModel::column_count |
( |
| ) |
const |
|
inline |
◆ row_count() [1/2]
| std::size_t pulp::view::TableModel::row_count |
( |
| ) |
const |
|
inline |
◆ row_count() [2/2]
| virtual int pulp::view::TableModel::row_count |
( |
| ) |
const |
|
pure virtual |
◆ row_double_clicked()
| virtual void pulp::view::TableModel::row_double_clicked |
( |
int | row | ) |
|
|
inlinevirtual |
Optional: called when a row is double-clicked.
◆ row_selected()
| virtual void pulp::view::TableModel::row_selected |
( |
int | row | ) |
|
|
inlinevirtual |
Optional: called when a row is selected.
◆ sort()
| virtual bool pulp::view::TableModel::sort |
( |
int | column, |
|
|
bool | ascending ) |
|
inlinevirtual |
◆ sort_by()
| void pulp::view::TableModel::sort_by |
( |
std::size_t | col, |
|
|
TableSortOrder | order ) |
Explicit sort (used by tests and by code that wants a specific order).
◆ sort_column()
| int pulp::view::TableModel::sort_column |
( |
| ) |
const |
|
inline |
◆ sort_order()
◆ toggle_sort()
| void pulp::view::TableModel::toggle_sort |
( |
std::size_t | col | ) |
|
Sort rows by column col.
Passing the same column cycles None → Ascending → Descending → None, matching how spreadsheet UIs toggle via header clicks.
The documentation for this class was generated from the following files:
- /home/runner/work/pulp/pulp/core/view/include/pulp/view/table.hpp
- /home/runner/work/pulp/pulp/core/view/include/pulp/view/table_model.hpp