2 #include "qcepproperty.h"
4 #include <QMetaProperty>
9 m_ObjectNamer(this, name),
10 m_Name(QcepSettingsSaverWPtr(), this,
"name", name,
"Object Name")
17 printf(
"%s\n", qPrintable(line));
20 QMetaObject::invokeMethod( parent(),
"printLine", Q_ARG(QString, line));
28 printf(
"%s\n", qPrintable(msg));
31 QMetaObject::invokeMethod( parent(),
"printMessage", Q_ARG(QString, msg), Q_ARG(QDateTime, dt));
33 printf(
"MESSAGE: %s %s\n",
34 qPrintable(dt.toString(
"hh:mm:ss")), qPrintable(msg));
41 const QMetaObject *meta = metaObject();
44 QcepProperty::writeSettings(
this, meta, section, set);
46 meta = meta->superClass();
48 if (meta == &QObject::staticMetaObject)
break;
54 QcepProperty::readSettings(
this, metaObject(), section, set);
61 return tr(
"[%1,%2,%3]").arg(dv.
x()).arg(dv.
y()).arg(dv.
z());
64 return tr(
"[%1,%2,%3]").arg(dv.
x()).arg(dv.
y()).arg(dv.
z());
67 return tr(
"[ [%1,%2,%3], [%4,%5,%6], [%7,%8,%9] ]")
68 .arg(m(0,0)).arg(m(0,1)).arg(m(0,2))
69 .arg(m(1,0)).arg(m(1,1)).arg(m(1,2))
70 .arg(m(2,0)).arg(m(2,1)).arg(m(2,2));
73 return tr(
"[%1,%2,%3, %4,%5,%6]")
74 .arg(u.
a()).arg(u.
b()).arg(u.
c())
76 }
else if (v.type() == QMetaType::QString) {
86 const QMetaObject* metaObject = this->metaObject();
88 for (
int i=1; i < metaObject->propertyCount(); i++) {
89 QMetaProperty prop = metaObject->property(i);
91 if (prop.isStored()) {
92 res += tr(
"%1.%2 = %3;\n").arg(this->get_Name())
QString scriptValueLiteral(QVariant v)
virtual QString settingsScript()
static QString addSlashes(QString str)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
virtual void readSettings(QSettings *set, QString section)
virtual void printLine(QString line)
virtual void writeSettings(QSettings *set, QString section)
CctwObject(QString name, QObject *parent=0)