QXRD  0.11.16
Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
QcepStringPropertyComboBoxHelper Class Reference

#include <qcepproperty.h>

Inheritance diagram for QcepStringPropertyComboBoxHelper:
Inheritance graph
[legend]
Collaboration diagram for QcepStringPropertyComboBoxHelper:
Collaboration graph
[legend]

Public Slots

void setValue (QString value, int index)
 
void setCurrentIndex (int current)
 

Signals

void valueChanged (QString value, int index)
 

Public Member Functions

 QcepStringPropertyComboBoxHelper (QComboBox *comboBox, QcepStringProperty *property)
 
void connect ()
 

Private Attributes

QComboBox * m_ComboBox
 
QcepStringPropertym_Property
 

Detailed Description

Definition at line 271 of file qcepproperty.h.

Constructor & Destructor Documentation

QcepStringPropertyComboBoxHelper::QcepStringPropertyComboBoxHelper ( QComboBox *  comboBox,
QcepStringProperty property 
)

Definition at line 1579 of file qcepproperty.cpp.

1580  : QObject(comboBox),
1581  m_ComboBox(comboBox),
1582  m_Property(property)
1583 {
1584 }
QcepStringProperty * m_Property
Definition: qcepproperty.h:287

Member Function Documentation

void QcepStringPropertyComboBoxHelper::connect ( )

Definition at line 1586 of file qcepproperty.cpp.

References CONNECT_CHECK, m_ComboBox, and setCurrentIndex().

1587 {
1588  CONNECT_CHECK(QObject::connect(m_ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setCurrentIndex(int)), Qt::DirectConnection));
1589 }
#define CONNECT_CHECK(res)
Definition: qcepmacros.h:14

Here is the call graph for this function:

void QcepStringPropertyComboBoxHelper::setCurrentIndex ( int  current)
slot

Definition at line 1616 of file qcepproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, QcepProperty::incIndex(), m_ComboBox, m_Property, QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), QcepByteArrayProperty::value(), and valueChanged().

Referenced by connect().

1617 {
1619  m_Property->printMessage(tr("%1: QcepStringPropertyComboBoxHelper::setCurrentIndex(int %2)")
1620  .arg(m_Property->name()).arg(current));
1621  }
1622 
1623  QString value = m_ComboBox->itemData(current).toString();
1624 
1625  emit valueChanged(value, m_Property->incIndex(1));
1626 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
int incIndex(int step)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
void valueChanged(QString value, int index)
QcepStringProperty * m_Property
Definition: qcepproperty.h:287
int debug() const

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepStringPropertyComboBoxHelper::setValue ( QString  value,
int  index 
)
slot

Definition at line 1591 of file qcepproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, QcepProperty::index(), m_ComboBox, m_Property, QcepProperty::name(), QcepProperty::printMessage(), and qcepDebug().

1592 {
1594  m_Property->printMessage(tr("%1: QcepIntPropertyComboBoxHelper::setValue(int %2, int %3) [%4,%5]")
1595  .arg(m_Property->name()).arg(value).arg(index)
1596  .arg(m_Property->index()).arg(m_ComboBox->currentIndex()));
1597  }
1598 
1599  if (m_Property->index() == index) {
1600  int current = m_ComboBox->findData(value);
1601 
1602  if (m_ComboBox->currentIndex() != current) {
1604  m_Property->printMessage(tr("%1: QcepIntPropertyComboBoxHelper comboBox %2 set to %3")
1605  .arg(m_Property->name()).arg(m_ComboBox->objectName()).arg(value));
1606  }
1607 
1608  bool block = m_ComboBox->blockSignals(true);
1609 
1610  m_ComboBox->setCurrentIndex(current);
1611  m_ComboBox->blockSignals(block);
1612  }
1613  }
1614 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QcepStringProperty * m_Property
Definition: qcepproperty.h:287
int debug() const

Here is the call graph for this function:

void QcepStringPropertyComboBoxHelper::valueChanged ( QString  value,
int  index 
)
signal

Referenced by setCurrentIndex().

Here is the caller graph for this function:

Member Data Documentation

QComboBox* QcepStringPropertyComboBoxHelper::m_ComboBox
private

Definition at line 286 of file qcepproperty.h.

Referenced by connect(), setCurrentIndex(), and setValue().

QcepStringProperty* QcepStringPropertyComboBoxHelper::m_Property
private

Definition at line 287 of file qcepproperty.h.

Referenced by setCurrentIndex(), and setValue().


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