SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Signals | Public Member Functions | Private Slots | Private Attributes | List of all members
DynamicArgSettingGUI Class Reference

#include <dynamicargsettinggui.h>

Inherits QObject.

+ Collaboration diagram for DynamicArgSettingGUI:

Signals

void valueChanged (QString itemName, QVariant value)
 

Public Member Functions

 DynamicArgSettingGUI (ArgInfoGUI *argSettingGUI, const QString &name, QObject *parent=0)
 
 ~DynamicArgSettingGUI ()
 
const QString & getName () const
 
QVariant getValue () const
 
void setValue (const QVariant &value)
 

Private Slots

void processValueChanged ()
 

Private Attributes

ArgInfoGUIm_argSettingGUI
 
QString m_name
 

Detailed Description

Definition at line 28 of file dynamicargsettinggui.h.

Constructor & Destructor Documentation

◆ DynamicArgSettingGUI()

DynamicArgSettingGUI::DynamicArgSettingGUI ( ArgInfoGUI argSettingGUI,
const QString &  name,
QObject *  parent = 0 
)

Definition at line 20 of file dynamicargsettinggui.cpp.

References m_argSettingGUI, processValueChanged(), and valueChanged().

20  :
21  QObject(parent),
22  m_argSettingGUI(argSettingGUI),
23  m_name(name)
24 {
25  connect(m_argSettingGUI, SIGNAL(valueChanged()), this, SLOT(processValueChanged()));
26 }
void valueChanged(QString itemName, QVariant value)
+ Here is the call graph for this function:

◆ ~DynamicArgSettingGUI()

DynamicArgSettingGUI::~DynamicArgSettingGUI ( )

Definition at line 28 of file dynamicargsettinggui.cpp.

References m_argSettingGUI, processValueChanged(), and valueChanged().

29 {
30  disconnect(m_argSettingGUI, SIGNAL(valueChanged()), this, SLOT(processValueChanged()));
31 }
void valueChanged(QString itemName, QVariant value)
+ Here is the call graph for this function:

Member Function Documentation

◆ getName()

const QString& DynamicArgSettingGUI::getName ( ) const
inline

Definition at line 35 of file dynamicargsettinggui.h.

References SWGSDRangel::setValue().

35 { return m_name; }
+ Here is the call graph for this function:

◆ getValue()

QVariant DynamicArgSettingGUI::getValue ( ) const

Definition at line 46 of file dynamicargsettinggui.cpp.

References ArgInfoGUI::ArgInfoValueBool, ArgInfoGUI::ArgInfoValueFloat, ArgInfoGUI::ArgInfoValueInt, ArgInfoGUI::ArgInfoValueString, ArgInfoGUI::getBoolValue(), ArgInfoGUI::getFloatValue(), ArgInfoGUI::getIntValue(), ArgInfoGUI::getStringValue(), ArgInfoGUI::getValueType(), and m_argSettingGUI.

47 {
49  return QVariant(m_argSettingGUI->getBoolValue());
51  return QVariant(m_argSettingGUI->getIntValue());
53  return QVariant(m_argSettingGUI->getFloatValue());
55  return QVariant(m_argSettingGUI->getStringValue());
56  } else {
57  return QVariant(false);
58  }
59 }
double getFloatValue() const
Definition: arginfogui.h:68
ArgInfoValueType getValueType() const
Definition: arginfogui.h:57
bool getBoolValue() const
Definition: arginfogui.h:60
const QString & getStringValue() const
Definition: arginfogui.h:72
int getIntValue() const
Definition: arginfogui.h:64
+ Here is the call graph for this function:

◆ processValueChanged

void DynamicArgSettingGUI::processValueChanged ( )
privateslot

Definition at line 33 of file dynamicargsettinggui.cpp.

References ArgInfoGUI::ArgInfoValueBool, ArgInfoGUI::ArgInfoValueFloat, ArgInfoGUI::ArgInfoValueInt, ArgInfoGUI::ArgInfoValueString, ArgInfoGUI::getBoolValue(), ArgInfoGUI::getFloatValue(), ArgInfoGUI::getIntValue(), ArgInfoGUI::getStringValue(), ArgInfoGUI::getValueType(), m_argSettingGUI, m_name, and valueChanged().

Referenced by DynamicArgSettingGUI(), and ~DynamicArgSettingGUI().

34 {
36  emit valueChanged(m_name, QVariant(m_argSettingGUI->getBoolValue()));
38  emit valueChanged(m_name, QVariant(m_argSettingGUI->getIntValue()));
43  }
44 }
void valueChanged(QString itemName, QVariant value)
double getFloatValue() const
Definition: arginfogui.h:68
ArgInfoValueType getValueType() const
Definition: arginfogui.h:57
bool getBoolValue() const
Definition: arginfogui.h:60
const QString & getStringValue() const
Definition: arginfogui.h:72
int getIntValue() const
Definition: arginfogui.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setValue()

void DynamicArgSettingGUI::setValue ( const QVariant &  value)

Definition at line 61 of file dynamicargsettinggui.cpp.

References m_argSettingGUI, ArgInfoGUI::setBoolValue(), ArgInfoGUI::setFloatValue(), ArgInfoGUI::setIntValue(), and ArgInfoGUI::setStringValue().

62 {
63  bool ok = false;
64 
65  if (value.type() == QVariant::Bool)
66  {
67  m_argSettingGUI->setBoolValue(value.toBool());
68  }
69  else if (value.type() == QVariant::Int)
70  {
71  int newValue = value.toInt(&ok);
72 
73  if (ok) {
74  m_argSettingGUI->setIntValue(newValue);
75  }
76  }
77  else if (value.type() == QVariant::Double)
78  {
79  double newValue = value.toDouble(&ok);
80 
81  if (ok) {
82  m_argSettingGUI->setFloatValue(newValue);
83  }
84  }
85  else if (value.type() == QVariant::String)
86  {
87  m_argSettingGUI->setStringValue(value.toString());
88  }
89 }
void setIntValue(int value)
Definition: arginfogui.cpp:131
void setBoolValue(bool value)
Definition: arginfogui.cpp:100
void setFloatValue(double value)
Definition: arginfogui.cpp:162
void setStringValue(const QString &value)
Definition: arginfogui.cpp:193
+ Here is the call graph for this function:

◆ valueChanged

void DynamicArgSettingGUI::valueChanged ( QString  itemName,
QVariant  value 
)
signal

Referenced by DynamicArgSettingGUI(), processValueChanged(), and ~DynamicArgSettingGUI().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_argSettingGUI

ArgInfoGUI* DynamicArgSettingGUI::m_argSettingGUI
private

◆ m_name

QString DynamicArgSettingGUI::m_name
private

Definition at line 47 of file dynamicargsettinggui.h.

Referenced by processValueChanged().


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