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

Simple string table model for grid/table UI components. More...

#include <RADWidgets.h>

+ Inheritance diagram for RADUi::TableModel:
+ Collaboration diagram for RADUi::TableModel:

Public Member Functions

size_t rowCount () const
 Returns number of rows. More...
 
size_t columnCount () const
 Returns number of columns. More...
 
std::string value (size_t row, size_t column) const
 Returns a cell value or empty string when out of range. More...
 
void setColumnCount (size_t columns)
 Sets the table column count. More...
 
void appendRow (std::vector< std::string > row)
 Appends a row, padding/truncating to column count as needed. More...
 
void setValue (size_t row, size_t column, std::string value)
 Sets one cell value. More...
 
void clear ()
 Removes all rows and columns. 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 row, column, or cell data changes. More...
 

Detailed Description

Simple string table model for grid/table UI components.

Member Function Documentation

◆ appendRow()

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

Appends a row, padding/truncating to column count as needed.

◆ clear()

void RADUi::TableModel::clear ( )

Removes all rows and columns.

◆ columnCount()

size_t RADUi::TableModel::columnCount ( ) const

Returns number of columns.

◆ rowCount()

size_t RADUi::TableModel::rowCount ( ) const

Returns number of rows.

◆ setColumnCount()

void RADUi::TableModel::setColumnCount ( size_t  columns)

Sets the table column count.

◆ setValue()

void RADUi::TableModel::setValue ( size_t  row,
size_t  column,
std::string  value 
)

Sets one cell value.

◆ value()

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

Returns a cell value or empty string when out of range.

Member Data Documentation

◆ changed

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

Raised when row, column, or cell data changes.


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