qmca  0.0.20
Public Slots | Public Member Functions | Private Attributes | List of all members
EpicsEnumerationComboBox Class Reference

#include <epicsenumerationcombobox.h>

Inheritance diagram for EpicsEnumerationComboBox:
Inheritance graph

Public Slots

void changeEpicsVariable ()
 
void setValue (int val)
 
void changeValueList ()
 

Public Member Functions

 EpicsEnumerationComboBox (EpicsEnumeration *var, QWidget *parent=0)
 
virtual ~EpicsEnumerationComboBox ()
 
int value ()
 
QString valueString ()
 

Private Attributes

EpicsEnumerationm_EpicsEnumeration
 

Detailed Description

Definition at line 10 of file epicsenumerationcombobox.h.

Constructor & Destructor Documentation

EpicsEnumerationComboBox::EpicsEnumerationComboBox ( EpicsEnumeration var,
QWidget *  parent = 0 
)

Definition at line 7 of file epicsenumerationcombobox.cpp.

References changeEpicsVariable(), changeValueList(), m_EpicsEnumeration, setValue(), EpicsObject::toolTip(), and EpicsEnumeration::value().

8  : QComboBox(parent),
10 {
11  connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(changeEpicsVariable()));
12  connect(m_EpicsEnumeration, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
13  connect(m_EpicsEnumeration, SIGNAL(valueListChanged()),
14  this, SLOT(changeValueList()));
15 
17  setToolTip(m_EpicsEnumeration->toolTip());
18 }
EpicsEnumeration * m_EpicsEnumeration
QString toolTip()
Definition: epicsobject.cpp:35
EpicsEnumerationComboBox::~EpicsEnumerationComboBox ( )
virtual

Definition at line 20 of file epicsenumerationcombobox.cpp.

21 {
22 }

Member Function Documentation

void EpicsEnumerationComboBox::changeEpicsVariable ( )
slot

Definition at line 24 of file epicsenumerationcombobox.cpp.

References m_EpicsEnumeration, and value().

Referenced by changeValueList(), and EpicsEnumerationComboBox().

25 {
26 // printf("Set Epics value -> %d\n", value());
27 
28  m_EpicsEnumeration -> caput(value());
29 }
EpicsEnumeration * m_EpicsEnumeration
void EpicsEnumerationComboBox::changeValueList ( )
slot

Definition at line 38 of file epicsenumerationcombobox.cpp.

References changeEpicsVariable(), m_EpicsEnumeration, and EpicsEnumeration::valueList().

Referenced by EpicsEnumerationComboBox().

39 {
40 // printf("EpicsEnumerationComboBox::changeValueList\n");
41 
42  disconnect(this, SIGNAL(currentIndexChanged(int)),
43  this, SLOT(changeEpicsVariable()));
44 
45  int val = currentIndex();
46 
47  clear();
48 
49  addItems(m_EpicsEnumeration->valueList());
50 
51  setCurrentIndex(val);
52 
53  connect(this, SIGNAL(currentIndexChanged(int)),
54  this, SLOT(changeEpicsVariable()));
55 }
QStringList valueList()
EpicsEnumeration * m_EpicsEnumeration
void EpicsEnumerationComboBox::setValue ( int  val)
slot

Definition at line 31 of file epicsenumerationcombobox.cpp.

Referenced by EpicsEnumerationComboBox().

32 {
33 // printf("EpicsEnumerationComboBox::setValue(%d)\n", val);
34 
35  setCurrentIndex(val);
36 }
int EpicsEnumerationComboBox::value ( )

Definition at line 57 of file epicsenumerationcombobox.cpp.

Referenced by changeEpicsVariable().

58 {
59  return currentIndex();
60 }
QString EpicsEnumerationComboBox::valueString ( )

Member Data Documentation

EpicsEnumeration* EpicsEnumerationComboBox::m_EpicsEnumeration
private

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