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

#include <qcepproperty.h>

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

Public Slots

void setValue (QPointF val, int index)
 
void setValue (QPointF val)
 
void setDefaultValue (QPointF val)
 
void resetValue ()
 
void setSubValue (int axis, double value, int index)
 
void setSubValue (int axis, double value)
 

Signals

void valueChanged (QPointF val, int index)
 
void subValueChanged (int axis, double val, int index)
 

Public Member Functions

 QcepDoublePointProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QPointF value, QString toolTip)
 
QPointF value () const
 
QPointF defaultValue () const
 
double subValue (int axis) const
 
void linkTo (QDoubleSpinBox *xSpinBox, QDoubleSpinBox *ySpinBox)
 
void linkTo (int axis, QDoubleSpinBox *spinBox)
 
- 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

QPointF m_Default
 
QPointF 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 504 of file qcepproperty.h.

Constructor & Destructor Documentation

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

Definition at line 2462 of file qcepproperty.cpp.

2463  : QcepProperty(saver, parent, name, toolTip),
2464  m_Default(value),
2465  m_Value(value)
2466 {
2467 }
QPointF value() const
QString name() const
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QString toolTip() const

Member Function Documentation

QPointF QcepDoublePointProperty::defaultValue ( ) const

Definition at line 2476 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

Referenced by resetValue().

2477 {
2478  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2479 
2480  return m_Default;
2481 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepDoublePointProperty::linkTo ( QDoubleSpinBox *  xSpinBox,
QDoubleSpinBox *  ySpinBox 
)

Definition at line 2595 of file qcepproperty.cpp.

2596 {
2597  if (xSpinBox) {
2598  linkTo(0, xSpinBox);
2599  }
2600 
2601  if (ySpinBox) {
2602  linkTo(1, ySpinBox);
2603  }
2604 }
void linkTo(QDoubleSpinBox *xSpinBox, QDoubleSpinBox *ySpinBox)
void QcepDoublePointProperty::linkTo ( int  axis,
QDoubleSpinBox *  spinBox 
)

Definition at line 2606 of file qcepproperty.cpp.

References QcepDoublePointPropertyDoubleSpinBoxHelper::connect(), QcepProperty::m_Mutex, setSubValue(), setValue(), QcepProperty::setWidgetToolTip(), subValue(), and subValueChanged().

2607 {
2608  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2609 
2611  = new QcepDoublePointPropertyDoubleSpinBoxHelper(spinBox, this, axis);
2612 
2613  helper->moveToThread(spinBox->thread());
2614  helper->connect();
2615 
2616  spinBox -> setValue(subValue(axis));
2617  spinBox -> setKeyboardTracking(false);
2618 
2619  setWidgetToolTip(spinBox);
2620 
2621  connect(this, SIGNAL(subValueChanged(int,double,int)), helper, SLOT(setSubValue(int,double,int)));
2622  connect(helper, SIGNAL(subValueChanged(int,double,int)), this, SLOT(setSubValue(int,double,int)));
2623 }
void setSubValue(int axis, double value, int index)
void setWidgetToolTip(QWidget *widget)
QMutex m_Mutex
Definition: qcepproperty.h:69
void subValueChanged(int axis, double val, int index)
double subValue(int axis) const
void setValue(QPointF val, int index)

Here is the call graph for this function:

void QcepDoublePointProperty::resetValue ( )
slot

Definition at line 2586 of file qcepproperty.cpp.

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

2587 {
2588  if (qcepDebug(DEBUG_PROPERTIES)) {
2589  printMessage(tr("%1: QcepDoublePointProperty::resetValue").arg(name()));
2590  }
2591 
2593 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QPointF defaultValue() const
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
void setValue(QPointF val, int index)

Here is the call graph for this function:

void QcepDoublePointProperty::setDefaultValue ( QPointF  val)
slot

Definition at line 2577 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

2578 {
2579  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2580 
2581  if (val != m_Default) {
2582  m_Default = val;
2583  }
2584 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void QcepDoublePointProperty::setSubValue ( int  axis,
double  value,
int  index 
)
slot

Definition at line 2543 of file qcepproperty.cpp.

References QcepProperty::index().

Referenced by linkTo().

2544 {
2545  if (index == this->index()) {
2546  setSubValue(axis, value);
2547  }
2548 }
void setSubValue(int axis, double value, int index)
QPointF value() const

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepDoublePointProperty::setSubValue ( int  axis,
double  value 
)
slot

Definition at line 2550 of file qcepproperty.cpp.

References QcepProperty::incIndex(), QcepProperty::m_Mutex, m_Value, subValueChanged(), and valueChanged().

2551 {
2552  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2553 
2554  if (axis == 0) {
2555  if (value != m_Value.x()) {
2556  int newIndex = incIndex(1);
2557 
2558  emit subValueChanged(0, value, newIndex);
2559 
2560  m_Value.setX(value);
2561 
2562  emit valueChanged(m_Value, newIndex);
2563  }
2564  } else {
2565  if (value != m_Value.y()) {
2566  int newIndex = incIndex(1);
2567 
2568  emit subValueChanged(1, value, newIndex);
2569 
2570  m_Value.setY(value);
2571 
2572  emit valueChanged(m_Value, newIndex);
2573  }
2574  }
2575 }
QMutex m_Mutex
Definition: qcepproperty.h:69
int incIndex(int step)
QPointF value() const
void subValueChanged(int axis, double val, int index)
void valueChanged(QPointF val, int index)

Here is the call graph for this function:

void QcepDoublePointProperty::setValue ( QPointF  val,
int  index 
)
slot

Definition at line 2494 of file qcepproperty.cpp.

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

Referenced by linkTo(), and resetValue().

2495 {
2496  if (debug()) {
2497  printMessage(tr("%1 QcepDoublePointProperty::setValue(QPointF(%2,%3), int %4) [%5]")
2498  .arg(name()).arg(val.x()).arg(val.y()).arg(index).arg(this->index()));
2499  }
2500 
2501  if (index == this->index()) {
2502  setValue(val);
2503  }
2504 }
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
int debug() const
void setValue(QPointF val, int index)

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepDoublePointProperty::setValue ( QPointF  val)
slot

Definition at line 2506 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(), subValueChanged(), and valueChanged().

2507 {
2508  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2509 
2510  if (qcepDebug(DEBUG_PROPERTIES)) {
2511  printMessage(tr("%1: QcepDoublePointProperty::setValue(QPointF(%2,%3)")
2512  .arg(name()).arg(val.x()).arg(val.y()));
2513  }
2514 
2515  if (val != m_Value) {
2516  int newIndex = incIndex(1);
2517 
2518  if (debug()) {
2519  printMessage(tr("%1: QcepDoublePointProperty::setValue(QPointF(%2,%3)) [%4]")
2520  .arg(name()).arg(val.x()).arg(val.y()).arg(index()));
2521  }
2522 
2523  if (val.x() != m_Value.x()) {
2524  emit subValueChanged(0, val.x(), newIndex);
2525  }
2526 
2527  if (val.y() != m_Value.y()) {
2528  emit subValueChanged(1, val.y(), newIndex);
2529  }
2530 
2531  m_Value = val;
2532 
2534 
2535  if (saver) {
2536  saver->changed(this);
2537  }
2538 
2539  emit valueChanged(m_Value, newIndex);
2540  }
2541 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QMutex m_Mutex
Definition: qcepproperty.h:69
int incIndex(int step)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
void subValueChanged(int axis, double val, int index)
QString name() const
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
int debug() const
void valueChanged(QPointF val, int index)
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70

Here is the call graph for this function:

double QcepDoublePointProperty::subValue ( int  axis) const

Definition at line 2483 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and m_Value.

Referenced by linkTo().

2484 {
2485  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2486 
2487  if (axis == 0) {
2488  return m_Value.x();
2489  } else {
2490  return m_Value.y();
2491  }
2492 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepDoublePointProperty::subValueChanged ( int  axis,
double  val,
int  index 
)
signal

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

Here is the caller graph for this function:

QPointF QcepDoublePointProperty::value ( ) const

Definition at line 2469 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and m_Value.

2470 {
2471  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2472 
2473  return m_Value;
2474 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void QcepDoublePointProperty::valueChanged ( QPointF  val,
int  index 
)
signal

Referenced by setSubValue(), and setValue().

Here is the caller graph for this function:

Member Data Documentation

QPointF QcepDoublePointProperty::m_Default
private

Definition at line 529 of file qcepproperty.h.

Referenced by defaultValue(), and setDefaultValue().

QPointF QcepDoublePointProperty::m_Value
private

Definition at line 530 of file qcepproperty.h.

Referenced by setSubValue(), setValue(), subValue(), and value().


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