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

#include <qcepproperty.h>

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

Public Slots

void setValue (QByteArray val, int index)
 
void setValue (QByteArray val)
 
void setDefaultValue (QByteArray val)
 
void resetValue ()
 
void clear ()
 

Signals

void valueChanged (QByteArray val, int index)
 

Public Member Functions

 QcepByteArrayProperty (QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QByteArray value, QString toolTip)
 
QByteArray value () const
 
QByteArray defaultValue () const
 
QString toString (const QByteArray &list)
 
- 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

QByteArray m_Default
 
QByteArray 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 480 of file qcepproperty.h.

Constructor & Destructor Documentation

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

Definition at line 2359 of file qcepproperty.cpp.

2360  : QcepProperty(saver, parent, name, toolTip),
2361  m_Default(value),
2362  m_Value(value)
2363 {
2364 }
QString name() const
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QByteArray value() const
QString toolTip() const

Member Function Documentation

void QcepByteArrayProperty::clear ( )
slot

Definition at line 2392 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and setValue().

2393 {
2394  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2395 
2396  setValue(QByteArray());
2397 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void setValue(QByteArray val, int index)

Here is the call graph for this function:

QByteArray QcepByteArrayProperty::defaultValue ( ) const

Definition at line 2373 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

Referenced by resetValue().

2374 {
2375  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2376 
2377  return m_Default;
2378 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepByteArrayProperty::resetValue ( )
slot

Definition at line 2453 of file qcepproperty.cpp.

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

2454 {
2455  if (qcepDebug(DEBUG_PROPERTIES)) {
2456  printMessage(tr("%1: QcepByteArrayProperty::resetValue").arg(name()));
2457  }
2458 
2460 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QByteArray defaultValue() const
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
void setValue(QByteArray val, int index)

Here is the call graph for this function:

void QcepByteArrayProperty::setDefaultValue ( QByteArray  val)
slot

Definition at line 2446 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

2447 {
2448  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2449 
2450  m_Default = val;
2451 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void QcepByteArrayProperty::setValue ( QByteArray  val,
int  index 
)
slot

Definition at line 2380 of file qcepproperty.cpp.

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

Referenced by clear(), and resetValue().

2381 {
2382  if (debug()) {
2383  printMessage(tr("%1 QcepByteArrayProperty::setValue(QByteArray %2, int %3) [%4]")
2384  .arg(name()).arg(toString(val)).arg(index).arg(this->index()));
2385  }
2386 
2387  if (index == this->index()) {
2388  setValue(val);
2389  }
2390 }
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString toString(const QByteArray &list)
QString name() const
int debug() const
void setValue(QByteArray val, int index)

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepByteArrayProperty::setValue ( QByteArray  val)
slot

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

2420 {
2421  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2422 
2423  if (qcepDebug(DEBUG_PROPERTIES)) {
2424  printMessage(tr("%1 QcepByteArrayProperty::setValue(QByteArray %2)")
2425  .arg(name()).arg(toString(val)));
2426  }
2427 
2428  if (val != m_Value) {
2429  if (debug()) {
2430  printMessage(tr("%1: QcepByteArrayProperty::setValue(QByteArray %2) [%3]")
2431  .arg(name()).arg(toString(val)).arg(index()));
2432  }
2433 
2434  m_Value = val;
2435 
2437 
2438  if (saver) {
2439  saver->changed(this);
2440  }
2441 
2442  emit valueChanged(m_Value, incIndex(1));
2443  }
2444 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QMutex m_Mutex
Definition: qcepproperty.h:69
int incIndex(int step)
void valueChanged(QByteArray val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString toString(const QByteArray &list)
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 QcepByteArrayProperty::toString ( const QByteArray &  list)

Definition at line 2399 of file qcepproperty.cpp.

References QcepProperty::m_Mutex.

Referenced by setValue().

2400 {
2401  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2402 
2403  QString res = "[";
2404  int ct = val.count();
2405 
2406  for (int i=0; i<ct; i++) {
2407  if (i<(ct-1)) {
2408  res += tr("%1, ").arg(val[i]);
2409  } else {
2410  res += tr("%1").arg(val[i]);
2411  }
2412  }
2413 
2414  res += "]";
2415 
2416  return res;
2417 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

QByteArray QcepByteArrayProperty::value ( ) const
void QcepByteArrayProperty::valueChanged ( QByteArray  val,
int  index 
)
signal

Referenced by QcepDoublePointPropertyDoubleSpinBoxHelper::connect(), and setValue().

Here is the caller graph for this function:

Member Data Documentation

QByteArray QcepByteArrayProperty::m_Default
private

Definition at line 500 of file qcepproperty.h.

Referenced by defaultValue(), and setDefaultValue().

QByteArray QcepByteArrayProperty::m_Value
private

Definition at line 501 of file qcepproperty.h.

Referenced by setValue(), and value().


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