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

#include <qcepproperty.h>

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

Public Slots

void setValue (double val, int index)
 
void setValue (double val)
 
void incValue (double step)
 
void setDefaultValue (double val)
 
void resetValue ()
 

Signals

void valueChanged (double val, int index)
 
void stringValueChanged (QString val)
 

Public Member Functions

 QcepDoubleProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, double value, QString toolTip)
 
double value () const
 
double defaultValue () const
 
void linkTo (QDoubleSpinBox *spinBox)
 
void linkTo (QLabel *label)
 
void linkTo (QProgressBar *progress)
 
void linkTo (QLCDNumber *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

double m_Default
 
double 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 83 of file qcepproperty.h.

Constructor & Destructor Documentation

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

Definition at line 710 of file qcepproperty.cpp.

711  : QcepProperty(saver, parent, name, toolTip),
712  m_Default(value),
713  m_Value(value)
714 {
715 }
double value() const
QString name() const
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QString toolTip() const

Member Function Documentation

double QcepDoubleProperty::defaultValue ( ) const

Definition at line 724 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

Referenced by resetValue().

725 {
726  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
727 
728  return m_Default;
729 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepDoubleProperty::incValue ( double  step)
slot

Definition at line 773 of file qcepproperty.cpp.

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

774 {
775  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
776 
777  if (qcepDebug(DEBUG_PROPERTIES) || debug()) {
778  printMessage(tr("%1: QcepDoubleProperty::incValue(double %2)")
779  .arg(name()).arg(step));
780  }
781 
782  if (step) {
783  m_Value += step;
784 
786 
787  if (saver) {
788  saver->changed(this);
789  }
790 
791  emit valueChanged(value(), incIndex(1));
792  emit stringValueChanged(tr("%1").arg(value()));
793  }
794 }
void stringValueChanged(QString val)
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
double value() const
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
void valueChanged(double val, int index)
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70

Here is the call graph for this function:

void QcepDoubleProperty::linkTo ( QDoubleSpinBox *  spinBox)

Definition at line 814 of file qcepproperty.cpp.

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

815 {
816  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
817 
818  if (qcepDebug(DEBUG_PROPERTIES || debug())) {
819  printMessage(tr("%1: QcepDoubleProperty::linkTo(QDoubleSpinBox *%2)")
820  .arg(name()).HEXARG(spinBox));
821  }
822 
824  = new QcepDoublePropertyDoubleSpinBoxHelper(spinBox, this);
825 
826  helper->moveToThread(spinBox->thread());
827  helper->connect();
828 
829  spinBox -> setValue(value());
830  spinBox -> setKeyboardTracking(false);
831 
832  setWidgetToolTip(spinBox);
833 
834  connect(this, SIGNAL(valueChanged(double, int)), helper, SLOT(setValue(double, int)));
835  connect(helper, SIGNAL(valueChanged(double, int)), this, SLOT(setValue(double, int)));
836 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void setWidgetToolTip(QWidget *widget)
double value() const
QMutex m_Mutex
Definition: qcepproperty.h:69
void setValue(double val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
#define HEXARG(a)
Definition: qcepdebug.h:50
int debug() const
void valueChanged(double val, int index)

Here is the call graph for this function:

void QcepDoubleProperty::linkTo ( QLabel *  label)

Definition at line 838 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, QcepProperty::setWidgetToolTip(), stringValueChanged(), and value().

839 {
840  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
841 
842  label -> setText(tr("%1").arg(value()));
843 
844  setWidgetToolTip(label);
845 
846  connect(this, SIGNAL(stringValueChanged(QString)), label, SLOT(setText(QString)));
847 }
void stringValueChanged(QString val)
void setWidgetToolTip(QWidget *widget)
double value() const
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the call graph for this function:

void QcepDoubleProperty::linkTo ( QProgressBar *  progress)

Definition at line 849 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, setValue(), QcepProperty::setWidgetToolTip(), and valueChanged().

850 {
851  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
852 
853  setWidgetToolTip(progress);
854 
855  connect(this, SIGNAL(valueChanged(double,int)), progress, SLOT(setValue(int)));
856 }
void setWidgetToolTip(QWidget *widget)
QMutex m_Mutex
Definition: qcepproperty.h:69
void setValue(double val, int index)
void valueChanged(double val, int index)

Here is the call graph for this function:

void QcepDoubleProperty::linkTo ( QLCDNumber *  number)

Definition at line 858 of file qcepproperty.cpp.

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

859 {
860  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
861 
862  number -> display(value());
863 
864  setWidgetToolTip(number);
865 
866  connect(this, SIGNAL(valueChanged(double,int)), number, SLOT(display(double)));
867 }
void setWidgetToolTip(QWidget *widget)
double value() const
QMutex m_Mutex
Definition: qcepproperty.h:69
void valueChanged(double val, int index)

Here is the call graph for this function:

void QcepDoubleProperty::resetValue ( )
slot

Definition at line 803 of file qcepproperty.cpp.

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

804 {
805  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
806 
808  printMessage(tr("%1: QcepDoubleProperty::resetValue").arg(name()));
809  }
810 
812 }
double defaultValue() const
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QMutex m_Mutex
Definition: qcepproperty.h:69
void setValue(double val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const

Here is the call graph for this function:

void QcepDoubleProperty::setDefaultValue ( double  val)
slot

Definition at line 796 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

797 {
798  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
799 
800  m_Default = val;
801 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void QcepDoubleProperty::setValue ( double  val,
int  index 
)
slot

Definition at line 731 of file qcepproperty.cpp.

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

Referenced by linkTo(), QxrdFitParameter::readSettings(), and resetValue().

732 {
733  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
734 
735  if (debug()) {
736  printMessage(tr("%1 QcepDoubleProperty::setValue(double %2, int %3) [%4]")
737  .arg(name()).arg(val).arg(index).arg(this->index()));
738  }
739 
740  // if (index == this->index()) {
741  setValue(val);
742  // }
743 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void setValue(double val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
int debug() const

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepDoubleProperty::setValue ( double  val)
slot

Definition at line 745 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(), stringValueChanged(), value(), and valueChanged().

746 {
747  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
748 
750  printMessage(tr("%1: QcepDoubleProperty::setValue(double %2)")
751  .arg(name()).arg(val));
752  }
753 
754  if (val != value()) {
755  if (debug()) {
756  printMessage(tr("%1: QcepDoubleProperty::setValue(double %2) [%3]")
757  .arg(name()).arg(val).arg(index()));
758  }
759 
760  m_Value = val;
761 
763 
764  if (saver) {
765  saver->changed(this);
766  }
767 
768  emit valueChanged(value(), incIndex(1));
769  emit stringValueChanged(tr("%1").arg(value()));
770  }
771 }
void stringValueChanged(QString val)
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
double value() const
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
void valueChanged(double val, int index)
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70

Here is the call graph for this function:

void QcepDoubleProperty::stringValueChanged ( QString  val)
signal

Referenced by incValue(), linkTo(), and setValue().

Here is the caller graph for this function:

double QcepDoubleProperty::value ( ) const

Definition at line 717 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and m_Value.

Referenced by incValue(), linkTo(), setValue(), and QxrdFitParameter::writeSettings().

718 {
719  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
720 
721  return m_Value;
722 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepDoubleProperty::valueChanged ( double  val,
int  index 
)
signal

Member Data Documentation

double QcepDoubleProperty::m_Default
private

Definition at line 108 of file qcepproperty.h.

Referenced by defaultValue(), and setDefaultValue().

double QcepDoubleProperty::m_Value
private

Definition at line 109 of file qcepproperty.h.

Referenced by incValue(), setValue(), and value().


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