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

Current-selection model for list/table/tree style views. More...

#include <RADWidgets.h>

+ Inheritance diagram for RADUi::SelectionModel:
+ Collaboration diagram for RADUi::SelectionModel:

Public Member Functions

std::optional< size_t > currentIndex () const
 Returns selected index, if any. More...
 
void setCurrentIndex (std::optional< size_t > index)
 Sets selected index or clears selection with nullopt. More...
 
void clear ()
 Clears selection. 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 current index changes. More...
 

Detailed Description

Current-selection model for list/table/tree style views.

Member Function Documentation

◆ clear()

void RADUi::SelectionModel::clear ( )

Clears selection.

◆ currentIndex()

std::optional<size_t> RADUi::SelectionModel::currentIndex ( ) const

Returns selected index, if any.

◆ setCurrentIndex()

void RADUi::SelectionModel::setCurrentIndex ( std::optional< size_t >  index)

Sets selected index or clears selection with nullopt.

Member Data Documentation

◆ changed

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

Raised when current index changes.


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