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

#include <qcepproperty.h>

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

Public Slots

void setValue (QStringList val, int index)
 
void setValue (QStringList val)
 
void setDefaultValue (QStringList val)
 
void resetValue ()
 
void clear ()
 
void appendValue (QString val)
 

Signals

void valueChanged (QStringList val, int index)
 

Public Member Functions

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

QStringList m_Default
 
QStringList 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 455 of file qcepproperty.h.

Constructor & Destructor Documentation

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

Definition at line 2246 of file qcepproperty.cpp.

2247  : QcepProperty(saver, parent, name, toolTip),
2248  m_Default(value),
2249  m_Value(value)
2250 {
2251 }
QString name() const
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QString toolTip() const
QStringList value() const

Member Function Documentation

void QcepStringListProperty::appendValue ( QString  val)
slot

Definition at line 2286 of file qcepproperty.cpp.

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

2287 {
2288  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2289 
2290  QStringList list = value();
2291  list.append(val);
2292 
2293  setValue(list);
2294 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void setValue(QStringList val, int index)
QStringList value() const

Here is the call graph for this function:

void QcepStringListProperty::clear ( )
slot

Definition at line 2279 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and setValue().

2280 {
2281  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2282 
2284 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void setValue(QStringList val, int index)
QList< QString > QcepStringList
Definition: qcepmacros.h:34

Here is the call graph for this function:

QStringList QcepStringListProperty::defaultValue ( ) const

Definition at line 2260 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

Referenced by resetValue().

2261 {
2262  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2263 
2264  return m_Default;
2265 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepStringListProperty::resetValue ( )
slot

Definition at line 2350 of file qcepproperty.cpp.

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

2351 {
2352  if (qcepDebug(DEBUG_PROPERTIES)) {
2353  printMessage(tr("%1: QcepStringListProperty::resetValue").arg(name()));
2354  }
2355 
2357 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
void setValue(QStringList val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QStringList defaultValue() const

Here is the call graph for this function:

void QcepStringListProperty::setDefaultValue ( QStringList  val)
slot

Definition at line 2343 of file qcepproperty.cpp.

References m_Default, and QcepProperty::m_Mutex.

2344 {
2345  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2346 
2347  m_Default = val;
2348 }
QMutex m_Mutex
Definition: qcepproperty.h:69
void QcepStringListProperty::setValue ( QStringList  val,
int  index 
)
slot

Definition at line 2267 of file qcepproperty.cpp.

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

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

2268 {
2269  if (debug()) {
2270  printMessage(tr("%1 QcepStringListProperty::setValue(QcepStringList %2, int %3) [%4]")
2271  .arg(name()).arg(toString(val)).arg(index).arg(this->index()));
2272  }
2273 
2274  if (index == this->index()) {
2275  setValue(val);
2276  }
2277 }
void setValue(QStringList val, int index)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QString name() const
QString toString(const QStringList &list)
int debug() const

Here is the call graph for this function:

Here is the caller graph for this function:

void QcepStringListProperty::setValue ( QStringList  val)
slot

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

2317 {
2318  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2319 
2320  if (qcepDebug(DEBUG_PROPERTIES)) {
2321  printMessage(tr("%1 QcepStringListProperty::setValue(QcepStringList %2)")
2322  .arg(name()).arg(toString(val)));
2323  }
2324 
2325  if (val != m_Value) {
2326  if (debug()) {
2327  printMessage(tr("%1: QcepStringListProperty::setValue(QcepStringList %2) [%3]")
2328  .arg(name()).arg(toString(val)).arg(index()));
2329  }
2330 
2331  m_Value = val;
2332 
2334 
2335  if (saver) {
2336  saver->changed(this);
2337  }
2338 
2339  emit valueChanged(m_Value, incIndex(1));
2340  }
2341 }
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 valueChanged(QStringList val, int index)
QString name() const
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
QString toString(const QStringList &list)
int debug() const
QcepSettingsSaverWPtr m_Saver
Definition: qcepproperty.h:70

Here is the call graph for this function:

QString QcepStringListProperty::toString ( const QStringList &  list)

Definition at line 2296 of file qcepproperty.cpp.

References QcepProperty::m_Mutex.

Referenced by setValue().

2297 {
2298  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2299 
2300  QString res = "[";
2301  int ct = val.count();
2302 
2303  for (int i=0; i<ct; i++) {
2304  if (i<(ct-1)) {
2305  res += tr("%1, ").arg(val[i]);
2306  } else {
2307  res += tr("%1").arg(val[i]);
2308  }
2309  }
2310 
2311  res += "]";
2312 
2313  return res;
2314 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

QStringList QcepStringListProperty::value ( ) const

Definition at line 2253 of file qcepproperty.cpp.

References QcepProperty::m_Mutex, and m_Value.

Referenced by appendValue().

2254 {
2255  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);
2256 
2257  return m_Value;
2258 }
QMutex m_Mutex
Definition: qcepproperty.h:69

Here is the caller graph for this function:

void QcepStringListProperty::valueChanged ( QStringList  val,
int  index 
)
signal

Referenced by setValue().

Here is the caller graph for this function:

Member Data Documentation

QStringList QcepStringListProperty::m_Default
private

Definition at line 476 of file qcepproperty.h.

Referenced by defaultValue(), and setDefaultValue().

QStringList QcepStringListProperty::m_Value
private

Definition at line 477 of file qcepproperty.h.

Referenced by setValue(), and value().


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