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

#include <qcepproperty.h>

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

Public Slots

void setValue (QcepIntVector val, int index)
 
void setValue (QcepIntVector val)
 
void incValue (QcepIntVector step)
 
void setDefaultValue (QcepIntVector val)
 
void resetValue ()
 
void clear ()
 
void appendValue (int val)
 

Signals

void valueChanged (QcepIntVector val, int index)
 

Public Member Functions

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

QcepIntVector m_Default
 
QcepIntVector 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 429 of file qcepproperty.h.

Constructor & Destructor Documentation

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

Definition at line 2111 of file qcepproperty.cpp.

2112  : QcepProperty(saver, parent, name, toolTip),
2113  m_Default(value),
2114  m_Value(value)
2115 {
2116 }
QcepIntVector m_Value
Definition: qcepproperty.h:452
QcepIntVector m_Default
Definition: qcepproperty.h:451
QString name() const
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QcepIntVector value() const
QString toolTip() const

Member Function Documentation

void QcepIntVectorProperty::appendValue ( int  val)
slot

Definition at line 2173 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, setValue(), and value().

2174 {
2175  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2176 
2177  QcepIntVector list = value();
2178  list.append(val);
2179 
2180  setValue(list);
2181 }
QVector< int > QcepIntVector
Definition: qcepmacros.h:23
void setValue(QcepIntVector val, int index)
QMutex m_Mutex
Definition: qcepproperty.h:69
QcepIntVector value() const

Here is the call graph for this function:

void QcepIntVectorProperty::clear ( )
slot

Definition at line 2166 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and setValue().

2167 {
2168  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2169 
2171 }
QVector< int > QcepIntVector
Definition: qcepmacros.h:23
void setValue(QcepIntVector val, int index)
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the call graph for this function:

QcepIntVector QcepIntVectorProperty::defaultValue ( ) const

Definition at line 2125 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

Referenced by resetValue().

2126 {
2127  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2128 
2129  return m_Default;
2130 }
QMutex m_Mutex
Definition: qcepproperty.h:69
QcepIntVector m_Default
Definition: qcepproperty.h:451

Here is the caller graph for this function:

void QcepIntVectorProperty::incValue ( QcepIntVector  step)
slot

Definition at line 2144 of file qcepproperty.cpp.

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

2145 {
2146  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2147 
2148  if (qcepDebug(DEBUG_PROPERTIES) || debug()) {
2149  printMessage(tr("%1: QcepIntVectorProperty::incValue(QcepIntVector %2...)")
2150  .arg(name()).arg(step.value(0)));
2151  }
2152 
2153  for (int i=0; i<m_Value.count(); i++) {
2154  m_Value[i] += step.value(i);
2155  }
2156 
2158 
2159  if (saver) {
2160  saver->changed(this);
2161  }
2162 
2163  emit valueChanged(m_Value, incIndex(1));
2164 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QcepIntVector m_Value
Definition: qcepproperty.h:452
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(QcepIntVector val, int index)
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70

Here is the call graph for this function:

void QcepIntVectorProperty::resetValue ( )
slot

Definition at line 2237 of file qcepproperty.cpp.

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

2238 {
2239  if (qcepDebug(DEBUG_PROPERTIES)) {
2240  printMessage(tr("%1: QcepIntVectorProperty::resetValue").arg(name()));
2241  }
2242 
2244 }
void setValue(QcepIntVector val, int index)
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QcepIntVector defaultValue() const
QString name() const

Here is the call graph for this function:

void QcepIntVectorProperty::setDefaultValue ( QcepIntVector  val)
slot

Definition at line 2230 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

2231 {
2232  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2233 
2234  m_Default = val;
2235 }
QMutex m_Mutex
Definition: qcepproperty.h:69
QcepIntVector m_Default
Definition: qcepproperty.h:451
void QcepIntVectorProperty::setValue ( QcepIntVector  val,
int  index 
)
slot

Definition at line 2132 of file qcepproperty.cpp.

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

Referenced by appendValue(), clear(), and resetValue().

2133 {
2134  if (debug()) {
2135  printMessage(tr("%1 QcepIntVectorProperty::setValue(QcepIntVector %2, int %3) [%4]")
2136  .arg(name()).arg(toString(val)).arg(index).arg(this->index()));
2137  }
2138 
2139  if (index == this->index()) {
2140  setValue(val);
2141  }
2142 }
void setValue(QcepIntVector val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QString toString(const QcepIntVector &list)
int debug() const

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepIntVectorProperty::setValue ( QcepIntVector  val)
slot

Definition at line 2203 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().

2204 {
2205  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2206 
2207  if (qcepDebug(DEBUG_PROPERTIES)) {
2208  printMessage(tr("%1 QcepIntVectorProperty::setValue(QcepIntVector %2)")
2209  .arg(name()).arg(toString(val)));
2210  }
2211 
2212  if (val != m_Value) {
2213  if (debug()) {
2214  printMessage(tr("%1: QcepIntVectorProperty::setValue(QcepIntVector %2) [%3]")
2215  .arg(name()).arg(toString(val)).arg(index()));
2216  }
2217 
2218  m_Value = val;
2219 
2221 
2222  if (saver) {
2223  saver->changed(this);
2224  }
2225 
2226  emit valueChanged(m_Value, incIndex(1));
2227  }
2228 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QcepIntVector m_Value
Definition: qcepproperty.h:452
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
QString toString(const QcepIntVector &list)
int debug() const
void valueChanged(QcepIntVector val, int index)
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70

Here is the call graph for this function:

QString QcepIntVectorProperty::toString ( const QcepIntVector list)

Definition at line 2183 of file qcepproperty.cpp.

References QcepProperty::m_Mutex.

Referenced by setValue().

2184 {
2185  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2186 
2187  QString res = "[";
2188  int ct = val.count();
2189 
2190  for (int i=0; i<ct; i++) {
2191  if (i<(ct-1)) {
2192  res += tr("%1, ").arg(val[i]);
2193  } else {
2194  res += tr("%1").arg(val[i]);
2195  }
2196  }
2197 
2198  res += "]";
2199 
2200  return res;
2201 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

QcepIntVector QcepIntVectorProperty::value ( ) const

Definition at line 2118 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and m_Value.

Referenced by appendValue().

2119 {
2120  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2121 
2122  return m_Value;
2123 }
QcepIntVector m_Value
Definition: qcepproperty.h:452
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepIntVectorProperty::valueChanged ( QcepIntVector  val,
int  index 
)
signal

Referenced by incValue(), and setValue().

Here is the caller graph for this function:

Member Data Documentation

QcepIntVector QcepIntVectorProperty::m_Default
private

Definition at line 451 of file qcepproperty.h.

Referenced by defaultValue(), and setDefaultValue().

QcepIntVector QcepIntVectorProperty::m_Value
private

Definition at line 452 of file qcepproperty.h.

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


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