RADLib
RADical C++ application framework
RADUi::VirtualTableModel Class Reference

Virtual string table with columns, filter, and selected row. More...

#include <RADAppKit.h>

+ Inheritance diagram for RADUi::VirtualTableModel:
+ Collaboration diagram for RADUi::VirtualTableModel:

Public Member Functions

void setColumns (std::vector< TableColumn > columns)
 Sets column descriptors. More...
 
const std::vector< TableColumn > & columns () const
 Returns columns. More...
 
void setRows (std::vector< std::vector< std::string >> rows)
 Sets all rows. More...
 
void appendRow (std::vector< std::string > row)
 Appends one row. More...
 
size_t rowCount () const
 Returns unfiltered row count. More...
 
size_t columnCount () const
 Returns column count. More...
 
std::vector< size_t > filteredIndexes () const
 Returns filtered row indexes. More...
 
std::string value (size_t row, size_t column) const
 Returns value by source row and column. More...
 
void setFilter (std::string filter)
 Sets filter text. More...
 
const std::string & filter () const
 Returns filter text. More...
 
void setSelectedRow (std::optional< size_t > row)
 Sets selected source row. More...
 
std::optional< size_t > selectedRow () const
 Returns selected source row. More...
 
bool activateRow (size_t row)
 Activates source row. More...
 
void clear ()
 Removes all rows. More...
 
- Public Member Functions inherited from RADCore::RADObject
 RADObject ()
 Creates a RADObject bound to the current thread. More...
 
virtual ~RADObject ()
 Disconnects tracked event links and releases lifetime token. More...
 
void registerLink (const ConnectionRecord &record)
 Registers a connection for cleanup when this object is destroyed. More...
 
std::thread::id threadId () const
 Returns the thread id this object is currently associated with. More...
 
EventLoopassociatedEventLoop () const
 Returns the associated event loop, if any. More...
 
ThreadAffinity threadAffinity () const
 Returns both thread id and associated loop atomically. More...
 
std::weak_ptr< void > lifetimeToken () const
 Returns a weak token used to drop queued callbacks after destruction. More...
 
void moveToThread (std::thread::id tId, EventLoop *loop=nullptr)
 Moves the object's affinity to tId and optional loop. More...
 

Public Attributes

RADCore::Event< void() > changed
 Raised when table state changes. More...
 
RADCore::Event< void(size_t) > rowActivated
 Raised when a row is activated. More...
 

Detailed Description

Virtual string table with columns, filter, and selected row.

Member Function Documentation

◆ activateRow()

bool RADUi::VirtualTableModel::activateRow ( size_t  row)

Activates source row.

◆ appendRow()

void RADUi::VirtualTableModel::appendRow ( std::vector< std::string >  row)

Appends one row.

◆ clear()

void RADUi::VirtualTableModel::clear ( )

Removes all rows.

◆ columnCount()

size_t RADUi::VirtualTableModel::columnCount ( ) const

Returns column count.

◆ columns()

const std::vector<TableColumn>& RADUi::VirtualTableModel::columns ( ) const

Returns columns.

◆ filter()

const std::string& RADUi::VirtualTableModel::filter ( ) const

Returns filter text.

◆ filteredIndexes()

std::vector<size_t> RADUi::VirtualTableModel::filteredIndexes ( ) const

Returns filtered row indexes.

◆ rowCount()

size_t RADUi::VirtualTableModel::rowCount ( ) const

Returns unfiltered row count.

◆ selectedRow()

std::optional<size_t> RADUi::VirtualTableModel::selectedRow ( ) const

Returns selected source row.

◆ setColumns()

void RADUi::VirtualTableModel::setColumns ( std::vector< TableColumn columns)

Sets column descriptors.

◆ setFilter()

void RADUi::VirtualTableModel::setFilter ( std::string  filter)

Sets filter text.

◆ setRows()

void RADUi::VirtualTableModel::setRows ( std::vector< std::vector< std::string >>  rows)

Sets all rows.

◆ setSelectedRow()

void RADUi::VirtualTableModel::setSelectedRow ( std::optional< size_t >  row)

Sets selected source row.

◆ value()

std::string RADUi::VirtualTableModel::value ( size_t  row,
size_t  column 
) const

Returns value by source row and column.

Member Data Documentation

◆ changed

RADCore::Event<void () > RADUi::VirtualTableModel::changed

Raised when table state changes.

◆ rowActivated

RADCore::Event<void (size_t) > RADUi::VirtualTableModel::rowActivated

Raised when a row is activated.


The documentation for this class was generated from the following file: