Version: 8.3.0
YACS::HMI::CaseSwitchEditor Class Reference

#include <ValueDelegate.hxx>

Inheritance diagram for YACS::HMI::CaseSwitchEditor:
Collaboration diagram for YACS::HMI::CaseSwitchEditor:

Public Member Functions

 CaseSwitchEditor (Subject *subject, const ValueDelegate *delegate, int column=0, QWidget *parent=0)
 
virtual ~CaseSwitchEditor ()
 
virtual QString GetStrValue ()
 
virtual void setData (QVariant val)
 
- Public Member Functions inherited from YACS::HMI::CaseSwitch
 CaseSwitch (QWidget *parent=0)
 
 ~CaseSwitch ()
 
bool isDefaultChecked ()
 
void setDefaultChecked (bool isDefault)
 
- Public Member Functions inherited from YACS::HMI::GenericEditor
 GenericEditor ()
 
virtual ~GenericEditor ()
 
virtual void setSubject (Subject *subject)
 
virtual void setColumn (int column)
 
virtual void setDelegate (const ValueDelegate *delegate)
 
virtual SubjectgetSubject ()
 
virtual int getColumnInSubject ()
 
virtual bool firstSetData ()
 

Additional Inherited Members

- Public Slots inherited from YACS::HMI::CaseSwitch
void on_cb_default_stateChanged (int state)
 
- Protected Attributes inherited from YACS::HMI::CaseSwitch
bool _isDefault
 
- Protected Attributes inherited from YACS::HMI::GenericEditor
Subject_subject
 
int _column
 
const ValueDelegate_delegate
 
bool _first
 

Detailed Description

Definition at line 102 of file ValueDelegate.hxx.

Constructor & Destructor Documentation

CaseSwitchEditor::CaseSwitchEditor ( Subject subject,
const ValueDelegate delegate,
int  column = 0,
QWidget parent = 0 
)

Definition at line 199 of file ValueDelegate.cxx.

References YACS::HMI::GenericEditor::setColumn(), YACS::HMI::GenericEditor::setDelegate(), and YACS::HMI::GenericEditor::setSubject().

203  : CaseSwitch(parent), GenericEditor()
204 {
205  sb_case->setMinimum(INT_MIN);
206  sb_case->setMaximum(INT_MAX);
207  setSubject(subject);
208  setDelegate(delegate);
209  setColumn(column);
210 }
CaseSwitchEditor::~CaseSwitchEditor ( )
virtual

Definition at line 212 of file ValueDelegate.cxx.

213 {
214 }

Member Function Documentation

QString CaseSwitchEditor::GetStrValue ( )
virtual

Reimplemented from YACS::HMI::GenericEditor.

Definition at line 216 of file ValueDelegate.cxx.

References YACS::HMI::CaseSwitch::_isDefault, DEBTRACE, and YACS::ENGINE::Switch::ID_FOR_DEFAULT_NODE.

217 {
218  QString str;
219  int val = sb_case->value();
220  if (_isDefault)
222  str.setNum(val);
223  DEBTRACE(val);
224  return str;
225 }
void CaseSwitchEditor::setData ( QVariant  val)
virtual

Reimplemented from YACS::HMI::GenericEditor.

Definition at line 227 of file ValueDelegate.cxx.

References DEBTRACE, and YACS::HMI::CaseSwitch::setDefaultChecked().

228 {
229  DEBTRACE("CaseSwitchEditor::setData");
230  if (val == "default")
231  {
232  setDefaultChecked(true);
233  }
234  else
235  {
236  setDefaultChecked(false);
237  DEBTRACE(val.canConvert<int>() << " " << val.toInt());
238  sb_case->setValue(val.toInt());
239  }
240 }

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