UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
RadioButtonUi Class Reference

#include <radioButton_ui.hpp>

Inheritance diagram for RadioButtonUi:
Inheritance graph
Collaboration diagram for RadioButtonUi:
Collaboration graph

Public Member Functions

 RadioButtonUi (QAbstractButton *btn, const std::string &selectedVal, Settings *settings, const std::string &opt)
 
- Public Member Functions inherited from WidgetUi
 WidgetUi (const WidgetUi &)=delete
 
 WidgetUi (Settings *settings, const std::string &opt)
 
 WidgetUi (WidgetUi &&)=delete
 
virtual ~WidgetUi ()
 
WidgetUi & operator= (const WidgetUi &)=delete
 
WidgetUi & operator= (WidgetUi &&)=delete
 
virtual void refresh ()
 
void registerCallback (const std::string &option)
 
void registerCustomCallback (const std::string &option, Option::Callback callback, std::unique_ptr< ExtraCallbackData > &&extraDataPtr=nullptr)
 
void setOpt (const std::string &opt)
 

Private Slots

void btnClicked ()
 

Private Member Functions

void connectSignals () override
 
void optChangeCallback (Option &opt, bool suboption) override
 
void updateUiState () override
 
void updateUiState (bool checked)
 

Private Attributes

QAbstractButton * btn
 
std::string selectedVal
 

Additional Inherited Members

- Signals inherited from WidgetUi
void changed ()
 
- Protected Member Functions inherited from WidgetUi
void registerCallback ()
 
- Static Protected Member Functions inherited from WidgetUi
static void optChangeCallbackStatic (Option &, bool, void *)
 
- Protected Attributes inherited from WidgetUi
std::vector< std::unique_ptr< ExtraCallbackData > > extraData
 
std::string opt
 
std::vector< std::pair< std::string, Option::Callback > > registeredCallbacks
 
Settings * settings
 

Detailed Description

Definition at line 10 of file radioButton_ui.hpp.

Constructor & Destructor Documentation

◆ RadioButtonUi()

RadioButtonUi::RadioButtonUi ( QAbstractButton * btn,
const std::string & selectedVal,
Settings * settings,
const std::string & opt )

Definition at line 3 of file radioButton_ui.cpp.

6 :
8 btn(btn),
10{
14}
std::string selectedVal
QAbstractButton * btn
void updateUiState() override
void connectSignals() override
WidgetUi(Settings *settings, const std::string &opt)
Definition widget_ui.cpp:3
std::string opt
Definition widget_ui.hpp:34
void registerCallback()
Definition widget_ui.cpp:57
Settings * settings
Definition widget_ui.hpp:33

References connectSignals(), WidgetUi::registerCallback(), and updateUiState().

Here is the call graph for this function:

Member Function Documentation

◆ btnClicked

void RadioButtonUi::btnClicked ( )
privateslot

Definition at line 34 of file radioButton_ui.cpp.

34 {
36 emit changed();
37}
virtual void setValue(const std::string &val, bool suppressCallback=false)
Definition settings.cpp:73
const Option & getOption(const std::string &opt) const
Definition settings.cpp:384
void changed()

References WidgetUi::changed(), Settings::getOption(), WidgetUi::opt, selectedVal, WidgetUi::settings, and Option::setValue().

Referenced by connectSignals().

Here is the call graph for this function:

◆ connectSignals()

void RadioButtonUi::connectSignals ( )
overrideprivatevirtual

Implements WidgetUi.

Definition at line 16 of file radioButton_ui.cpp.

16 {
17 connect(btn, &QAbstractButton::clicked, this, &RadioButtonUi::btnClicked);
18}

References btn, and btnClicked().

Referenced by RadioButtonUi().

Here is the call graph for this function:

◆ optChangeCallback()

void RadioButtonUi::optChangeCallback ( Option & opt,
bool suboption )
overrideprivatevirtual

Implements WidgetUi.

Definition at line 28 of file radioButton_ui.cpp.

28 {
29 if(changedOpt.getName() == opt){
31 }
32}
std::string getValue() const
Definition settings.cpp:26

References Option::getName(), Settings::getOption(), Option::getValue(), WidgetUi::opt, selectedVal, WidgetUi::settings, and updateUiState().

Here is the call graph for this function:

◆ updateUiState() [1/2]

void RadioButtonUi::updateUiState ( )
overrideprivatevirtual

Implements WidgetUi.

Definition at line 24 of file radioButton_ui.cpp.

References Settings::getOption(), Option::getValue(), WidgetUi::opt, selectedVal, WidgetUi::settings, and updateUiState().

Referenced by RadioButtonUi(), optChangeCallback(), and updateUiState().

Here is the call graph for this function:

◆ updateUiState() [2/2]

void RadioButtonUi::updateUiState ( bool checked)
private

Definition at line 20 of file radioButton_ui.cpp.

20 {
21 btn->setChecked(checked);
22}

References btn.

Member Data Documentation

◆ btn

QAbstractButton* RadioButtonUi::btn
private

Definition at line 20 of file radioButton_ui.hpp.

Referenced by connectSignals(), and updateUiState().

◆ selectedVal

std::string RadioButtonUi::selectedVal
private

Definition at line 21 of file radioButton_ui.hpp.

Referenced by btnClicked(), optChangeCallback(), and updateUiState().


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