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

#include <qcepproperty.h>

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

Public Slots

void setValue (QString val, int index)
 
void setValue (QString val)
 
void setDefaultValue (QString val)
 
void resetValue ()
 

Signals

void valueChanged (QString val, int index)
 

Public Member Functions

 QcepStringProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString value, QString toolTip)
 
QString value () const
 
QString defaultValue () const
 
void linkTo (QComboBox *comboBox)
 
void linkTo (QLineEdit *lineEdit)
 
void linkTo (QLabel *label)
 
void linkTo (QLCDNumber *number)
 
void linkTo (QTextEdit *number)
 
- Public Member Functions inherited from QcepProperty
 QcepProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
 
virtual void printMessage (QString msg, QDateTime dt=QDateTime::currentDateTime())
 
QString name () const
 
void setName (QString name)
 
QString parentName () const
 
QString toolTip () const
 
void setToolTip (QString tip)
 
QString expandedToolTip () const
 
void setWidgetToolTip (QWidget *widget)
 
int index ()
 
int incIndex (int step)
 
int debug () const
 
void setDebug (int dbg)
 
void setSaver (QcepSettingsSaverWPtr saver)
 

Private Attributes

QString m_Default
 
QString m_Value
 

Additional Inherited Members

- Static Public Member Functions inherited from QcepProperty
static void registerMetaTypes ()
 
static void setSettingsValue (QSettings *settings, QString name, QVariant value)
 
static void writeSettings (QObject *object, QSettings *settings, QString section)
 
static void readSettings (QObject *object, QSettings *settings, QString section)
 
static void writeSettings (QObject *object, const QMetaObject *meta, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void readSettings (QObject *object, const QMetaObject *meta, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void writeSettings (QObject *object, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void readSettings (QObject *object, QString groupName, QSettings *settings, bool includeDynamic=false)
 
static void registerCustomSaver (QString typeName, CustomSettingsSaver *saver)
 
- Protected Attributes inherited from QcepProperty
QMutex m_Mutex
 
QcepSettingsSaverWPtr m_Saver
 

Detailed Description

Definition at line 243 of file qcepproperty.h.

Constructor & Destructor Documentation

QcepStringProperty::QcepStringProperty ( QcepSettingsSaverWPtr  saver,
QObject *  parent,
const char *  name,
QString  value,
QString  toolTip 
)

Definition at line 1330 of file qcepproperty.cpp.

1331  : QcepProperty(saver, parent, name, toolTip),
1332  m_Default(value),
1333  m_Value(value)
1334 {
1335 }
QString name() const
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QString value() const
QString toolTip() const

Member Function Documentation

QString QcepStringProperty::defaultValue ( ) const

Definition at line 1344 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

Referenced by resetValue().

1345 {
1346  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1347 
1348  return m_Default;
1349 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepStringProperty::linkTo ( QComboBox *  comboBox)

Definition at line 1406 of file qcepproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, HEXARG, QcepProperty::index(), QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), setValue(), QcepProperty::setWidgetToolTip(), value(), and valueChanged().

1407 {
1408  if (qcepDebug(DEBUG_PROPERTIES || debug())) {
1409  printMessage(tr("%1: QcepStringProperty::linkTo(QComboBox *%2)")
1410  .arg(name()).HEXARG(comboBox));
1411  }
1412 
1414  = new QcepStringPropertyComboBoxHelper(comboBox, this);
1415 
1416  helper -> moveToThread(comboBox->thread());
1417  helper -> connect();
1418 
1419  int index = comboBox->findData(value());
1420 
1421  comboBox -> setCurrentIndex(index);
1422 
1423  setWidgetToolTip(comboBox);
1424 
1425  connect(this, SIGNAL(valueChanged(QString, int)), helper, SLOT(setValue(QString, int)));
1426  connect(helper, SIGNAL(valueChanged(QString,int)), this, SLOT(setValue(QString, int)));
1427 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void valueChanged(QString val, int index)
void setWidgetToolTip(QWidget *widget)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
#define HEXARG(a)
Definition: qcepdebug.h:50
QString value() const
int debug() const
void setValue(QString val, int index)

Here is the call graph for this function:

void QcepStringProperty::linkTo ( QLineEdit *  lineEdit)

Definition at line 1429 of file qcepproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, HEXARG, QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), setValue(), QcepProperty::setWidgetToolTip(), value(), and valueChanged().

1430 {
1431  if (qcepDebug(DEBUG_PROPERTIES || debug())) {
1432  printMessage(tr("%1: QcepStringProperty::linkTo(QLineEdit *%2)")
1433  .arg(name()).HEXARG(lineEdit));
1434  }
1435 
1437  = new QcepStringPropertyLineEditHelper(lineEdit, this);
1438 
1439  helper -> moveToThread(lineEdit->thread());
1440  helper -> connect();
1441 
1442  lineEdit -> setText(value());
1443 
1444  setWidgetToolTip(lineEdit);
1445 
1446  connect(this, SIGNAL(valueChanged(QString, int)), helper, SLOT(setText(QString, int)));
1447  connect(helper, SIGNAL(textEdited(QString, int)), this, SLOT(setValue(QString, int)));
1448 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void valueChanged(QString val, int index)
void setWidgetToolTip(QWidget *widget)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
#define HEXARG(a)
Definition: qcepdebug.h:50
QString value() const
int debug() const
void setValue(QString val, int index)

Here is the call graph for this function:

void QcepStringProperty::linkTo ( QLabel *  label)

Definition at line 1450 of file qcepproperty.cpp.

References QcepProperty::setWidgetToolTip(), value(), and valueChanged().

1451 {
1452  label -> setText(value());
1453 
1454  setWidgetToolTip(label);
1455 
1456  connect(this, SIGNAL(valueChanged(QString,int)), label, SLOT(setText(QString)));
1457 }
void valueChanged(QString val, int index)
void setWidgetToolTip(QWidget *widget)
QString value() const

Here is the call graph for this function:

void QcepStringProperty::linkTo ( QLCDNumber *  number)

Definition at line 1459 of file qcepproperty.cpp.

References QcepProperty::setWidgetToolTip(), value(), and valueChanged().

1460 {
1461  number -> display(value());
1462 
1463  setWidgetToolTip(number);
1464 
1465  connect(this, SIGNAL(valueChanged(QString,int)), number, SLOT(display(QString)));
1466 }
void valueChanged(QString val, int index)
void setWidgetToolTip(QWidget *widget)
QString value() const

Here is the call graph for this function:

void QcepStringProperty::linkTo ( QTextEdit *  number)

Definition at line 1468 of file qcepproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, HEXARG, QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), setValue(), QcepProperty::setWidgetToolTip(), value(), and valueChanged().

1469 {
1470  if (qcepDebug(DEBUG_PROPERTIES || debug())) {
1471  printMessage(tr("%1: QcepStringProperty::linkTo(QTextEdit *%2)")
1472  .arg(name()).HEXARG(textEdit));
1473  }
1474 
1476  = new QcepStringPropertyTextEditHelper(textEdit, this);
1477 
1478  helper -> moveToThread(textEdit->thread());
1479  helper -> connect();
1480 
1481  textEdit -> setText(value());
1482 
1483  setWidgetToolTip(textEdit);
1484 
1485  connect(this, SIGNAL(valueChanged(QString, int)), helper, SLOT(setText(QString, int)));
1486  connect(helper, SIGNAL(textEdited(QString, int)), this, SLOT(setValue(QString, int)));
1487 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void valueChanged(QString val, int index)
void setWidgetToolTip(QWidget *widget)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
#define HEXARG(a)
Definition: qcepdebug.h:50
QString value() const
int debug() const
void setValue(QString val, int index)

Here is the call graph for this function:

void QcepStringProperty::resetValue ( )
slot

Definition at line 1397 of file qcepproperty.cpp.

References DEBUG_PROPERTIES, defaultValue(), QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), and setValue().

1398 {
1399  if (qcepDebug(DEBUG_PROPERTIES)) {
1400  printMessage(tr("%1: QcepStringProperty::resetValue").arg(name()));
1401  }
1402 
1404 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QString defaultValue() const
void setValue(QString val, int index)

Here is the call graph for this function:

void QcepStringProperty::setDefaultValue ( QString  val)
slot

Definition at line 1390 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

1391 {
1392  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1393 
1394  m_Default = val;
1395 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void QcepStringProperty::setValue ( QString  val,
int  index 
)
slot

Definition at line 1351 of file qcepproperty.cpp.

References QcepProperty::debug(), QcepProperty::index(), QcepProperty::name(), and QcepProperty::printMessage().

Referenced by linkTo(), and resetValue().

1352 {
1353  if (debug()) {
1354  printMessage(tr("%1 QcepStringProperty::setValue(QString \"%2\", int %3) [%4]")
1355  .arg(name()).arg(val).arg(index).arg(this->index()));
1356  }
1357 
1358  if (index == this->index()) {
1359  setValue(val);
1360  }
1361 }
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
int debug() const
void setValue(QString val, int index)

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepStringProperty::setValue ( QString  val)
slot

Definition at line 1363 of file qcepproperty.cpp.

References QcepProperty::debug(), DEBUG_PROPERTIES, QcepProperty::incIndex(), QcepProperty::index(), QcepProperty::m_Mutex, QcepProperty::m_Saver, m_Value, QcepProperty::name(), QcepProperty::printMessage(), qcepDebug(), and valueChanged().

1364 {
1365  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1366 
1367  if (qcepDebug(DEBUG_PROPERTIES)) {
1368  printMessage(tr("%1: QcepStringProperty::setValue(QString \"%2\")")
1369  .arg(name()).arg(val));
1370  }
1371 
1372  if (val != m_Value) {
1373  if (debug()) {
1374  printMessage(tr("%1: QcepStringProperty::setValue(QString \"%2\") [%3]")
1375  .arg(name()).arg(val).arg(index()));
1376  }
1377 
1378  m_Value = val;
1379 
1381 
1382  if (saver) {
1383  saver->changed(this);
1384  }
1385 
1386  emit valueChanged(m_Value, incIndex(1));
1387  }
1388 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void valueChanged(QString val, int index)
QMutex m_Mutex
Definition: qcepproperty.h:69
int incIndex(int step)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
int debug() const
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70

Here is the call graph for this function:

QString QcepStringProperty::value ( ) const

Definition at line 1337 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and m_Value.

Referenced by linkTo().

1338 {
1339  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
1340 
1341  return m_Value;
1342 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepStringProperty::valueChanged ( QString  val,
int  index 
)
signal

Member Data Documentation

QString QcepStringProperty::m_Default
private

Definition at line 267 of file qcepproperty.h.

Referenced by defaultValue(), and setDefaultValue().

QString QcepStringProperty::m_Value
private

Definition at line 268 of file qcepproperty.h.

Referenced by setValue(), and value().


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