|
RADLib
RADical C++ application framework
|
Simple string-list state model for list views and combo boxes. More...
#include <RADWidgets.h>
Inheritance diagram for RADUi::StringListModel:
Collaboration diagram for RADUi::StringListModel:Public Member Functions | |
| size_t | rowCount () const |
| Returns the number of list rows. More... | |
| bool | empty () const |
| Returns true when no values are stored. More... | |
| const std::string & | at (size_t index) const |
| Returns value at index. More... | |
| std::vector< std::string > | values () const |
| Returns a copy of all values. More... | |
| void | append (std::string value) |
| Appends one value and emits changed. More... | |
| void | set (size_t index, std::string value) |
| Replaces value at index and emits changed. More... | |
| void | remove (size_t index) |
| Removes value at index and emits changed. More... | |
| void | clear () |
| Removes all values and emits changed. 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... | |
| EventLoop * | associatedEventLoop () 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 list contents change. More... | |
Simple string-list state model for list views and combo boxes.
| void RADUi::StringListModel::append | ( | std::string | value | ) |
Appends one value and emits changed.
| const std::string& RADUi::StringListModel::at | ( | size_t | index | ) | const |
Returns value at index.
| void RADUi::StringListModel::clear | ( | ) |
Removes all values and emits changed.
| bool RADUi::StringListModel::empty | ( | ) | const |
Returns true when no values are stored.
| void RADUi::StringListModel::remove | ( | size_t | index | ) |
Removes value at index and emits changed.
| size_t RADUi::StringListModel::rowCount | ( | ) | const |
Returns the number of list rows.
| void RADUi::StringListModel::set | ( | size_t | index, |
| std::string | value | ||
| ) |
Replaces value at index and emits changed.
| std::vector<std::string> RADUi::StringListModel::values | ( | ) | const |
Returns a copy of all values.
| RADCore::Event<void () > RADUi::StringListModel::changed |
Raised when list contents change.