RADLib
RADical C++ application framework
RADCore::RADStringListModel Class Reference

One-column string list implementation of RADAbstractItemModel. More...

#include <RADCore.h>

+ Inheritance diagram for RADCore::RADStringListModel:
+ Collaboration diagram for RADCore::RADStringListModel:

Public Member Functions

size_t rowCount () const override
 Returns number of strings. More...
 
size_t columnCount () const override
 Returns 1. More...
 
RADVariant data (size_t row, size_t column=0) const override
 Returns row string as RADVariant. More...
 
void append (std::string value)
 Appends a value. More...
 
void set (size_t row, std::string value)
 Sets a row value. More...
 
void remove (size_t row)
 Removes a row. More...
 
void clear ()
 Clears all values. More...
 
const std::vector< std::string > & values () const
 Returns underlying values. More...
 
- Public Member Functions inherited from RADCore::RADAbstractItemModel
virtual ~RADAbstractItemModel ()=default
 Destroys model implementations through the base class. 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...
 

Additional Inherited Members

- Public Attributes inherited from RADCore::RADAbstractItemModel
RADCore::Event< void() > modelReset
 Raised when the model is reset. More...
 
RADCore::Event< void(size_t, size_t) > dataChanged
 Raised when data at row/column changes. More...
 
RADCore::Event< void(size_t, size_t) > rowsInserted
 Raised when rows are inserted. More...
 
RADCore::Event< void(size_t, size_t) > rowsRemoved
 Raised when rows are removed. More...
 

Detailed Description

One-column string list implementation of RADAbstractItemModel.

Member Function Documentation

◆ append()

void RADCore::RADStringListModel::append ( std::string  value)

Appends a value.

◆ clear()

void RADCore::RADStringListModel::clear ( )

Clears all values.

◆ columnCount()

size_t RADCore::RADStringListModel::columnCount ( ) const
overridevirtual

Returns 1.

Implements RADCore::RADAbstractItemModel.

◆ data()

RADVariant RADCore::RADStringListModel::data ( size_t  row,
size_t  column = 0 
) const
overridevirtual

Returns row string as RADVariant.

Implements RADCore::RADAbstractItemModel.

◆ remove()

void RADCore::RADStringListModel::remove ( size_t  row)

Removes a row.

◆ rowCount()

size_t RADCore::RADStringListModel::rowCount ( ) const
overridevirtual

Returns number of strings.

Implements RADCore::RADAbstractItemModel.

◆ set()

void RADCore::RADStringListModel::set ( size_t  row,
std::string  value 
)

Sets a row value.

◆ values()

const std::vector<std::string>& RADCore::RADStringListModel::values ( ) const

Returns underlying values.


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