11 #include <QDoubleSpinBox>
13 #include <QProgressBar>
14 #include <QAbstractButton>
15 #include <QMetaProperty>
36 const QMetaObject *metaObj = parent->metaObject();
39 int i = metaObj->indexOfProperty(name);
42 QMetaProperty metaProperty = metaObj->property(i);
44 if (metaProperty.isStored()) {
56 printMessage(tr(
"Warning: property %1 of parent %2 has saver but is not stored")
57 .arg(name).arg(parent?parent->objectName():
"NULL"));
115 if (pn.count() && nm.count() && tt.count()) {
116 return pn+
"."+nm+
"\n"+tt;
117 }
else if (pn.count() || nm.count()) {
118 return pn+
"."+nm+
"\n"+tt;
129 QString tt = widget->toolTip();
143 return m_Index.fetchAndAddOrdered(0);
150 return m_Index.fetchAndAddOrdered(step) + step;
169 qRegisterMetaType< QcepDoubleVector >(
"QcepDoubleVector");
170 qRegisterMetaType< QcepBoolVector >(
"QcepBoolVector");
171 qRegisterMetaType< QcepIntVector >(
"QcepIntVector");
172 qRegisterMetaType< QcepStringVector >(
"QcepStringVector");
173 qRegisterMetaType< QcepDoubleList >(
"QcepDoubleList");
174 qRegisterMetaType< QcepBoolList >(
"QcepBoolList");
175 qRegisterMetaType< QcepIntList >(
"QcepIntList");
176 qRegisterMetaType< QcepStringList >(
"QcepStringList");
177 qRegisterMetaType< QPointF >(
"QPointF");
178 qRegisterMetaType< QRectF >(
"QRectF");
179 qRegisterMetaType< QcepPolygon >(
"QcepPolygon");
180 qRegisterMetaType< QVariant >(
"QVariant");
181 qRegisterMetaType< QcepPropertyValue >(
"QcepPropertyValue");
182 qRegisterMetaType< QcepPropertyValue* >(
"QcepPropertyValue*");
183 qRegisterMetaType< QcepMatrix3x3 >(
"QcepMatrix3x3");
184 qRegisterMetaType< QcepVector3D >(
"QcepVector3D");
185 qRegisterMetaTypeStreamOperators< QcepDoubleVector >(
"QcepDoubleVector");
186 qRegisterMetaTypeStreamOperators< QcepBoolVector >(
"QcepBoolVector");
187 qRegisterMetaTypeStreamOperators< QcepIntVector >(
"QcepIntVector");
188 qRegisterMetaTypeStreamOperators< QcepStringVector >(
"QcepStringVector");
189 qRegisterMetaTypeStreamOperators< QcepDoubleList >(
"QcepDoubleList");
190 qRegisterMetaTypeStreamOperators< QcepBoolList >(
"QcepBoolList");
191 qRegisterMetaTypeStreamOperators< QcepIntList >(
"QcepIntList");
192 qRegisterMetaTypeStreamOperators< QcepStringList >(
"QcepStringList");
193 qRegisterMetaTypeStreamOperators< QPointF >(
"QPointF");
194 qRegisterMetaTypeStreamOperators< QRectF >(
"QRectF");
195 qRegisterMetaTypeStreamOperators< QcepPolygon >(
"QcepPolygon");
196 qRegisterMetaTypeStreamOperators< QcepMatrix3x3 >(
"QcepMatrix3x3");
197 qRegisterMetaTypeStreamOperators< QcepVector3D >(
"QcepVector3D");
212 settings->setValue(name, v);
215 QString typeName = v.typeName();
221 (*saver)(v, settings,
name);
234 settings->beginWriteArray(name, dv.count());
236 for (
int i=0; i<dv.count(); i++) {
237 settings->setArrayIndex(i);
238 settings->setValue(name, dv.value(i));
241 settings->endArray();
245 settings->beginWriteArray(name, dv.count());
247 for (
int i=0; i<dv.count(); i++) {
248 settings->setArrayIndex(i);
249 settings->setValue(name, dv.value(i));
252 settings->endArray();
256 settings->beginWriteArray(name, dv.count());
258 for (
int i=0; i<dv.count(); i++) {
259 settings->setArrayIndex(i);
260 settings->setValue(name, dv.value(i));
263 settings->endArray();
267 settings->beginWriteArray(name, dv.count());
269 for (
int i=0; i<dv.count(); i++) {
270 settings->setArrayIndex(i);
271 settings->setValue(name, dv.value(i));
274 settings->endArray();
278 settings->beginWriteArray(name, dv.count());
280 for (
int i=0; i<dv.count(); i++) {
281 settings->setArrayIndex(i);
282 settings->setValue(name, dv.value(i));
285 settings->endArray();
289 settings->beginWriteArray(name, dv.count());
291 for (
int i=0; i<dv.count(); i++) {
292 settings->setArrayIndex(i);
293 settings->setValue(name, dv.value(i));
296 settings->endArray();
300 settings->beginWriteArray(name, dv.count());
302 for (
int i=0; i<dv.count(); i++) {
303 settings->setArrayIndex(i);
304 settings->setValue(name, dv.value(i));
307 settings->endArray();
311 settings->beginWriteArray(name, dv.count());
313 for (
int i=0; i<dv.count(); i++) {
314 settings->setArrayIndex(i);
315 settings->setValue(name, dv.value(i));
318 settings->endArray();
322 settings->beginWriteArray(name, dv.count());
324 for (
int i=0; i<dv.count(); i++) {
325 settings->setArrayIndex(i);
327 settings->setValue(
"x", dv.value(i).x());
328 settings->setValue(
"y", dv.value(i).y());
332 settings->endArray();
333 }
else if (v.canConvert<QPointF>()) {
334 QPointF dv = v.value<QPointF>();
336 settings->beginGroup(name);
338 settings->setValue(
"x", dv.x());
339 settings->setValue(
"y", dv.y());
341 settings->endGroup();
342 }
else if (v.canConvert<QRectF>()) {
343 QRectF dv = v.value<QRectF>();
345 settings->beginGroup(name);
347 settings->setValue(
"left", dv.left());
348 settings->setValue(
"top", dv.top());
349 settings->setValue(
"right", dv.right());
350 settings->setValue(
"bottom", dv.bottom());
352 settings->endGroup();
375 }
else if (v.type() == QVariant::StringList) {
376 QStringList dv = v.toStringList();
378 settings->beginWriteArray(name, dv.count());
380 for (
int i=0; i<dv.count(); i++) {
381 settings->setArrayIndex(i);
382 settings->setValue(name, dv.value(i));
385 settings->endArray();
391 if (settings &&
object) {
392 const QMetaObject *meta =
object->metaObject();
393 int count = meta->propertyCount();
394 int offset = QObject::staticMetaObject.propertyCount();
396 settings->beginGroup(section);
398 for (
int i=offset; i<count; i++) {
399 QMetaProperty metaproperty = meta->property(i);
401 if (metaproperty.isStored()) {
402 const char *name = metaproperty.name();
403 QVariant
value =
object -> property(name);
406 QString msg = tr(
"Save %1/%2 = %3 [%4]")
407 .arg(section).arg(name)
408 .arg(value.toString()).arg(value.typeName());
410 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
412 Q_ARG(QDateTime, QDateTime::currentDateTime())));
421 foreach (name, object->dynamicPropertyNames()) {
425 settings->endGroup();
431 if (settings &&
object) {
432 int count = meta->propertyCount();
433 int offset = meta->propertyOffset();
435 settings->beginGroup(groupName);
437 for (
int i=offset; i<count; i++) {
438 QMetaProperty metaproperty = meta->property(i);
440 if (metaproperty.isStored()) {
441 const char *name = metaproperty.name();
442 QVariant
value =
object -> property(name);
445 QString msg = tr(
"Save %1/%2 = %3 [%4]")
446 .arg(groupName).arg(name)
447 .arg(value.toString()).arg(value.typeName());
449 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
451 Q_ARG(QDateTime, QDateTime::currentDateTime())));
458 if (includeDynamic) {
461 foreach (name, object->dynamicPropertyNames()) {
466 settings->endGroup();
472 if (settings &&
object) {
473 const QMetaObject *meta =
object->metaObject();
475 int count = meta->propertyCount();
476 int offset = QObject::staticMetaObject.propertyOffset();
478 settings->beginGroup(groupName);
480 for (
int i=offset; i<count; i++) {
481 QMetaProperty metaproperty = meta->property(i);
483 if (metaproperty.isStored()) {
484 const char *name = metaproperty.name();
485 QVariant
value =
object -> property(name);
488 QString msg = tr(
"Save %1/%2 = %3 [%4]")
489 .arg(groupName).arg(name)
490 .arg(value.toString()).arg(value.typeName());
492 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
494 Q_ARG(QDateTime, QDateTime::currentDateTime())));
501 if (includeDynamic) {
504 foreach (name, object->dynamicPropertyNames()) {
509 settings->endGroup();
515 if (settings &&
object) {
516 const QMetaObject *meta =
object->metaObject();
517 settings->beginGroup(section);
519 QStringList keys = settings->childKeys();
521 foreach (QString key, keys) {
523 QString msg = tr(
"Load %1/%2 = %3 [%4]")
524 .arg(section).arg(key)
525 .arg(settings->value(key).toString())
526 .arg(settings->value(key).typeName());
528 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
530 Q_ARG(QDateTime, QDateTime::currentDateTime())));
533 int metaindex = meta->indexOfProperty(qPrintable(key));
535 if (metaindex == 0) {
536 }
else if (metaindex > 0) {
537 QMetaProperty metaproperty = meta->property(metaindex);
539 if (metaproperty.isStored()) {
540 object -> setProperty(qPrintable(key), settings->value(key));
543 QString msg = tr(
"property %1 of %2 not stored").arg(key)
544 .arg(meta -> className());
546 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
548 Q_ARG(QDateTime, QDateTime::currentDateTime())));
552 object -> setProperty(qPrintable(key), settings->value(key));
556 settings->endGroup();
562 if (settings &&
object) {
563 settings->beginGroup(groupName);
565 QStringList keys = settings->childKeys();
567 foreach (QString key, keys) {
569 QString msg = tr(
"Load %1/%2 = %3 [%4]")
570 .arg(groupName).arg(key)
571 .arg(settings->value(key).toString())
572 .arg(settings->value(key).typeName());
574 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
576 Q_ARG(QDateTime, QDateTime::currentDateTime())));
579 int metaindex = meta->indexOfProperty(qPrintable(key));
581 if (metaindex == 0) {
582 }
else if (metaindex > 0) {
583 QMetaProperty metaproperty = meta->property(metaindex);
585 if (metaproperty.isStored()) {
586 object -> setProperty(qPrintable(key), settings->value(key));
589 QString msg = tr(
"property %1 of %2 not stored").arg(key)
590 .arg(meta -> className());
592 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
594 Q_ARG(QDateTime, QDateTime::currentDateTime())));
598 if (includeDynamic) {
599 object -> setProperty(qPrintable(key), settings->value(key));
601 QString msg = tr(
"property %1 of %2 does not exist")
602 .arg(key).arg(meta -> className());
604 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
606 Q_ARG(QDateTime, QDateTime::currentDateTime())));
611 settings->endGroup();
617 if (settings &&
object) {
618 const QMetaObject *meta =
object->metaObject();
620 settings->beginGroup(groupName);
622 QStringList keys = settings->childKeys();
624 foreach (QString key, keys) {
626 QString msg = tr(
"Load %1/%2 = %3 [%4]")
627 .arg(groupName).arg(key)
628 .arg(settings->value(key).toString())
629 .arg(settings->value(key).typeName());
631 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
633 Q_ARG(QDateTime, QDateTime::currentDateTime())));
636 int metaindex = meta->indexOfProperty(qPrintable(key));
638 if (metaindex == 0) {
639 }
else if (metaindex > 0) {
640 QMetaProperty metaproperty = meta->property(metaindex);
642 if (metaproperty.isStored()) {
643 object -> setProperty(qPrintable(key), settings->value(key));
646 QString msg = tr(
"property %1 of %2 not stored").arg(key)
647 .arg(meta -> className());
649 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
651 Q_ARG(QDateTime, QDateTime::currentDateTime())));
655 if (includeDynamic) {
656 object -> setProperty(qPrintable(key), settings->value(key));
658 QString msg = tr(
"property %1 of %2 does not exist")
659 .arg(key).arg(meta -> className());
661 INVOKE_CHECK(QMetaObject::invokeMethod(
object,
"printMessage",
663 Q_ARG(QDateTime, QDateTime::currentDateTime())));
668 settings->endGroup();
677 saver->printMessage(msg, ts);
681 Q_ARG(QDateTime, QDateTime::currentDateTime())));
683 printf(
"%s\n", qPrintable(msg));
736 printMessage(tr(
"%1 QcepDoubleProperty::setValue(double %2, int %3) [%4]")
737 .arg(
name()).arg(val).arg(index).arg(this->
index()));
750 printMessage(tr(
"%1: QcepDoubleProperty::setValue(double %2)")
751 .arg(
name()).arg(val));
754 if (val !=
value()) {
756 printMessage(tr(
"%1: QcepDoubleProperty::setValue(double %2) [%3]")
765 saver->changed(
this);
778 printMessage(tr(
"%1: QcepDoubleProperty::incValue(double %2)")
779 .arg(
name()).arg(step));
788 saver->changed(
this);
819 printMessage(tr(
"%1: QcepDoubleProperty::linkTo(QDoubleSpinBox *%2)")
826 helper->moveToThread(spinBox->thread());
830 spinBox -> setKeyboardTracking(
false);
842 label -> setText(tr(
"%1").arg(
value()));
862 number -> display(
value());
866 connect(
this, SIGNAL(
valueChanged(
double,
int)), number, SLOT(display(
double)));
871 m_DoubleSpinBox(spinBox),
884 m_Property->
printMessage(tr(
"%1: QcepDoublePropertyDoubleSpinBoxHelper::setValue(double %2, int %3) [%4,%5]")
923 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
932 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
942 printMessage(tr(
"%1 QcepIntProperty::setValue(int %2, int %3) [%4]")
943 .arg(
name()).arg(val).arg(index).arg(this->
index()));
946 if (index == this->
index()) {
954 printMessage(tr(
"%1: QcepIntProperty::setValue(int %2)")
955 .arg(
name()).arg(val));
958 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
965 printMessage(tr(
"%1: QcepIntProperty::setValue(int %2) [%3]")
969 m_Value.fetchAndStoreOrdered(val);
974 saver->changed(
this);
985 printMessage(tr(
"%1: QcepIntProperty::incValue(int %2)")
986 .arg(
name()).arg(step));
990 m_Value.fetchAndAddOrdered(step);
995 saver->changed(
this);
1020 printMessage(tr(
"%1: QcepIntProperty::linkTo(QSpinBox *%2)")
1027 helper->moveToThread(spinBox->thread());
1031 spinBox -> setKeyboardTracking(
false);
1042 printMessage(tr(
"%1: QcepIntProperty::linkTo(QComboBox *%2)")
1049 helper->moveToThread(comboBox->thread());
1052 comboBox -> setCurrentIndex(
value());
1056 connect(
this, SIGNAL(
valueChanged(
int,
int)), helper, SLOT(setCurrentIndex(
int,
int)));
1057 connect(helper, SIGNAL(currentIndexChanged(
int,
int)),
this, SLOT(
setValue(
int,
int)));
1063 label -> setText(tr(
"%1").arg(
value()));
1080 number -> display(
value());
1084 connect(
this, SIGNAL(
valueChanged(
int,
int)), number, SLOT(display(
int)));
1090 m_Property(property)
1113 bool block =
m_SpinBox->blockSignals(
true);
1131 : QObject(comboBox),
1132 m_ComboBox(comboBox),
1133 m_Property(property)
1183 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1192 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1202 printMessage(tr(
"%1 QcepBoolProperty::setValue(bool %2, int %3) [%4]")
1203 .arg(
name()).arg(val).arg(index).arg(this->
index()));
1206 if (index == this->
index()) {
1214 printMessage(tr(
"%1: QcepBoolProperty::setValue(bool %2)")
1215 .arg(
name()).arg(val));
1218 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1224 if ((
int) val != curVal) {
1226 printMessage(tr(
"%1: QcepBoolProperty::setValue(bool %2) [%3]")
1230 m_Value.fetchAndStoreOrdered(val);
1235 saver->changed(
this);
1258 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1268 printMessage(tr(
"%1: QcepBoolProperty::linkTo(QAbstractButton *%2)")
1275 helper->moveToThread(button->thread());
1278 button -> setChecked(
value());
1282 connect(
this, SIGNAL(
valueChanged(
bool,
int)), helper, SLOT(setChecked(
bool,
int)));
1283 connect(helper, SIGNAL(toggled(
bool,
int)),
this, SLOT(
setValue(
bool,
int)));
1289 m_Property(property)
1313 bool block =
m_Button->blockSignals(
true);
1354 printMessage(tr(
"%1 QcepStringProperty::setValue(QString \"%2\", int %3) [%4]")
1355 .arg(
name()).arg(val).arg(index).arg(this->
index()));
1358 if (index == this->
index()) {
1368 printMessage(tr(
"%1: QcepStringProperty::setValue(QString \"%2\")")
1369 .arg(
name()).arg(val));
1374 printMessage(tr(
"%1: QcepStringProperty::setValue(QString \"%2\") [%3]")
1383 saver->changed(
this);
1409 printMessage(tr(
"%1: QcepStringProperty::linkTo(QComboBox *%2)")
1416 helper -> moveToThread(comboBox->thread());
1417 helper -> connect();
1421 comboBox -> setCurrentIndex(index);
1432 printMessage(tr(
"%1: QcepStringProperty::linkTo(QLineEdit *%2)")
1439 helper -> moveToThread(lineEdit->thread());
1440 helper -> connect();
1442 lineEdit -> setText(
value());
1446 connect(
this, SIGNAL(
valueChanged(QString,
int)), helper, SLOT(setText(QString,
int)));
1447 connect(helper, SIGNAL(textEdited(QString,
int)),
this, SLOT(
setValue(QString,
int)));
1452 label -> setText(
value());
1456 connect(
this, SIGNAL(
valueChanged(QString,
int)), label, SLOT(setText(QString)));
1461 number -> display(
value());
1465 connect(
this, SIGNAL(
valueChanged(QString,
int)), number, SLOT(display(QString)));
1471 printMessage(tr(
"%1: QcepStringProperty::linkTo(QTextEdit *%2)")
1478 helper -> moveToThread(textEdit->thread());
1479 helper -> connect();
1481 textEdit -> setText(
value());
1485 connect(
this, SIGNAL(
valueChanged(QString,
int)), helper, SLOT(setText(QString,
int)));
1486 connect(helper, SIGNAL(textEdited(QString,
int)),
this, SLOT(
setValue(QString,
int)));
1490 : QObject(lineEdit),
1491 m_LineEdit(lineEdit),
1492 m_Property(property)
1504 m_Property->
printMessage(tr(
"%1: QcepStringPropertyLineEditHelper::setText(QString \"%2\", int %3) [%4,%5]")
1534 : QObject(textEdit),
1535 m_TextEdit(textEdit),
1536 m_Property(property)
1548 m_Property->
printMessage(tr(
"%1: QcepStringPropertyTextEditHelper::setText(QString \"%2\", int %3) [%4,%5]")
1580 : QObject(comboBox),
1581 m_ComboBox(comboBox),
1582 m_Property(property)
1652 printMessage(tr(
"%1 QcepDateTimeProperty::setValue(QDateTime \"%2\", int %3) [%4]")
1653 .arg(
name()).arg(val.toString()).arg(index).arg(this->
index()));
1656 if (index == this->
index()) {
1666 printMessage(tr(
"%1: QcepDateTimeProperty::setValue(QDateTime \"%2\")")
1667 .arg(
name()).arg(val.toString()));
1672 printMessage(tr(
"%1: QcepDateTimeProperty::setValue(QDateTime \"%2\") [%3]")
1673 .arg(
name()).arg(val.toString()).arg(
index()));
1681 saver->changed(
this);
1730 printMessage(tr(
"%1 QcepDoubleListProperty::setValue(QcepDoubleList %2, int %3) [%4]")
1734 if (index == this->
index()) {
1744 printMessage(tr(
"%1: QcepDoubleListProperty::incValue(QcepDoubleList %2...)")
1745 .arg(
name()).arg(step.value(0)));
1748 for (
int i=0; i<
m_Value.count(); i++) {
1755 saver->changed(
this);
1783 int ct = val.count();
1785 for (
int i=0; i<ct; i++) {
1787 res += tr(
"%1, ").arg(val[i]);
1789 res += tr(
"%1").arg(val[i]);
1803 printMessage(tr(
"%1 QcepDoubleListProperty::setValue(QcepDoubleList %2)")
1809 printMessage(tr(
"%1: QcepDoubleListProperty::setValue(QcepDoubleList %2) [%3]")
1818 saver->changed(
this);
1865 printMessage(tr(
"%1 QcepDoubleVectorProperty::setValue(QcepDoubleVector %2, int %3) [%4]")
1869 if (index == this->
index()) {
1879 printMessage(tr(
"%1: QcepDoubleVectorProperty::incValue(QcepDoubleVector %2...)")
1880 .arg(
name()).arg(step.value(0)));
1883 for (
int i=0; i<
m_Value.count(); i++) {
1890 saver->changed(
this);
1918 int ct = val.count();
1920 for (
int i=0; i<ct; i++) {
1922 res += tr(
"%1, ").arg(val[i]);
1924 res += tr(
"%1").arg(val[i]);
1938 printMessage(tr(
"%1 QcepDoubleVectorProperty::setValue(QcepDoubleVector %2)")
1944 printMessage(tr(
"%1: QcepDoubleVectorProperty::setValue(QcepDoubleVector %2) [%3]")
1953 saver->changed(
this);
2000 printMessage(tr(
"%1 QcepIntListProperty::setValue(QcepIntList %2, int %3) [%4]")
2004 if (index == this->
index()) {
2014 printMessage(tr(
"%1: QcepIntListProperty::incValue(QcepDoubleList %2...)")
2015 .arg(
name()).arg(step.value(0)));
2018 for (
int i=0; i<
m_Value.count(); i++) {
2025 saver->changed(
this);
2053 int ct = val.count();
2055 for (
int i=0; i<ct; i++) {
2057 res += tr(
"%1, ").arg(val[i]);
2059 res += tr(
"%1").arg(val[i]);
2073 printMessage(tr(
"%1 QcepIntListProperty::setValue(QcepIntList %2)")
2079 printMessage(tr(
"%1: QcepIntListProperty::setValue(QcepIntList %2) [%3]")
2088 saver->changed(
this);
2135 printMessage(tr(
"%1 QcepIntVectorProperty::setValue(QcepIntVector %2, int %3) [%4]")
2139 if (index == this->
index()) {
2149 printMessage(tr(
"%1: QcepIntVectorProperty::incValue(QcepIntVector %2...)")
2150 .arg(
name()).arg(step.value(0)));
2153 for (
int i=0; i<
m_Value.count(); i++) {
2160 saver->changed(
this);
2188 int ct = val.count();
2190 for (
int i=0; i<ct; i++) {
2192 res += tr(
"%1, ").arg(val[i]);
2194 res += tr(
"%1").arg(val[i]);
2208 printMessage(tr(
"%1 QcepIntVectorProperty::setValue(QcepIntVector %2)")
2214 printMessage(tr(
"%1: QcepIntVectorProperty::setValue(QcepIntVector %2) [%3]")
2223 saver->changed(
this);
2270 printMessage(tr(
"%1 QcepStringListProperty::setValue(QcepStringList %2, int %3) [%4]")
2274 if (index == this->
index()) {
2290 QStringList list =
value();
2301 int ct = val.count();
2303 for (
int i=0; i<ct; i++) {
2305 res += tr(
"%1, ").arg(val[i]);
2307 res += tr(
"%1").arg(val[i]);
2321 printMessage(tr(
"%1 QcepStringListProperty::setValue(QcepStringList %2)")
2327 printMessage(tr(
"%1: QcepStringListProperty::setValue(QcepStringList %2) [%3]")
2336 saver->changed(
this);
2383 printMessage(tr(
"%1 QcepByteArrayProperty::setValue(QByteArray %2, int %3) [%4]")
2387 if (index == this->
index()) {
2404 int ct = val.count();
2406 for (
int i=0; i<ct; i++) {
2408 res += tr(
"%1, ").arg(val[i]);
2410 res += tr(
"%1").arg(val[i]);
2424 printMessage(tr(
"%1 QcepByteArrayProperty::setValue(QByteArray %2)")
2430 printMessage(tr(
"%1: QcepByteArrayProperty::setValue(QByteArray %2) [%3]")
2439 saver->changed(
this);
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()));
2501 if (index == this->
index()) {
2511 printMessage(tr(
"%1: QcepDoublePointProperty::setValue(QPointF(%2,%3)")
2512 .arg(
name()).arg(val.x()).arg(val.y()));
2519 printMessage(tr(
"%1: QcepDoublePointProperty::setValue(QPointF(%2,%3)) [%4]")
2520 .arg(
name()).arg(val.x()).arg(val.y()).arg(
index()));
2536 saver->changed(
this);
2545 if (index == this->
index()) {
2613 helper->moveToThread(spinBox->thread());
2617 spinBox -> setKeyboardTracking(
false);
2628 m_DoubleSpinBox(spinBox),
2629 m_Property(property),
2681 printMessage(tr(
"%1 QcepDoubleRectProperty::setValue(QRectF([%2,%3],[%4,%5]), int %6) [%7]")
2682 .arg(
name()).arg(val.left()).arg(val.top()).arg(val.right()).arg(val.bottom()).arg(index).arg(this->
index()));
2685 if (index == this->
index()) {
2695 printMessage(tr(
"%1: QcepDoubleRectProperty::setValue(QRectF([%2,%3],[%4,%5])")
2696 .arg(
name()).arg(val.top()).arg(val.right()).arg(val.bottom()));
2701 printMessage(tr(
"%1: QcepDoubleRectProperty::setValue(QRectF([%2,%3],[%4,%5])) [%6]")
2702 .arg(
name()).arg(val.top()).arg(val.right()).arg(val.bottom()).arg(
index()));
2710 saver->changed(
this);
2759 printMessage(tr(
"%1 QcepPolygonProperty::setValue(QcepPolygon(...), int %2) [%3]")
2760 .arg(
name()).arg(index).arg(this->
index()));
2763 if (index == this->
index()) {
2773 printMessage(tr(
"%1: QcepPolygonProperty::setValue(QcepPolygon(...)")
2779 printMessage(tr(
"%1: QcepPolygonProperty::setValue(QcepPolygon(...)) [%2]")
2788 saver->changed(
this);
2852 printMessage(tr(
"%1 QcepInt64Property::setValue(qint64 %2, int %3) [%4]")
2853 .arg(
name()).arg(val).arg(index).arg(this->
index()));
2856 if (index == this->
index()) {
2866 printMessage(tr(
"%1: QcepInt64Property::setValue(qint64 %2)")
2867 .arg(
name()).arg(val));
2872 printMessage(tr(
"%1: QcepInt64Property::setValue(qint64 %2) [%3]")
2881 saver->changed(
this);
2894 printMessage(tr(
"%1: QcepInt64Property::incValue(qint64 %2)")
2895 .arg(
name()).arg(step));
2904 saver->changed(
this);
void setName(QString name)
QVector< int > QcepIntVector
void setCurrentIndex(int current)
void setSubValue(int axis, double value, int index)
QVector< bool > QcepBoolVector
double defaultValue() const
void currentIndexChanged(int value, int index)
void setDefaultValue(qint64 val)
void setValue(QcepIntVector val, int index)
void stringValueChanged(QString val)
QcepPolygon defaultValue() const
QcepIntList defaultValue() const
QRectF defaultValue() const
void appendValue(QPointF pt)
static void readSettings(QObject *object, QSettings *settings, QString section)
QList< bool > QcepBoolList
QcepStringPropertyLineEditHelper(QLineEdit *lineEdit, QcepStringProperty *property)
void setValue(int val, int index)
qint64 qcepDebug(int cond)
QcepIntList value() const
void valueChanged(QString val, int index)
void setWidgetToolTip(QWidget *widget)
void setValue(double value)
void setDefaultValue(QcepIntList val)
QcepStringPropertyTextEditHelper(QTextEdit *textEdit, QcepStringProperty *property)
void linkTo(QAbstractButton *button)
void setSettingsValue(QSettings *settings, QString name)
QcepDoubleProperty * m_Property
void setDefaultValue(int val)
void setValue(QString value, int index)
void textEdited(QString value, int index)
void valueChanged(QDateTime val, int index)
QcepDoubleVector defaultValue() const
void linkTo(QDoubleSpinBox *spinBox)
void setDefaultValue(QRectF val)
QByteArray defaultValue() const
void incValue(QcepIntVector step)
void setDefaultValue(QPointF val)
QPointF defaultValue() const
void setValue(QcepIntList val, int index)
QcepIntVectorProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepIntVector value, QString toolTip)
QcepDoubleListProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepDoubleList value, QString toolTip)
static void registerMetaTypes()
void incValue(QcepDoubleVector step)
void setValue(double val, int index)
void setSettingsValue(QSettings *settings, QString name)
void linkTo(QDoubleSpinBox *xSpinBox, QDoubleSpinBox *ySpinBox)
void setValue(QRectF val, int index)
QcepDoublePropertyDoubleSpinBoxHelper(QDoubleSpinBox *spinBox, QcepDoubleProperty *property)
QcepDoubleVectorProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepDoubleVector value, QString toolTip)
QcepPolygon value() const
void setValue(QDateTime val, int index)
QDoubleSpinBox * m_DoubleSpinBox
QcepInt64Property(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, qint64 value, QString toolTip)
void incValue(QcepDoubleList step)
void setSaver(QcepSettingsSaverWPtr saver)
void setValue(QStringList val, int index)
void setText(QString value, int index)
void setDefaultValue(QString val)
void valueChanged(QcepDoubleList val, int index)
void setDefaultValue(bool val)
void setDefaultValue(QDateTime val)
QcepBoolProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, bool value, QString toolTip)
QcepStringListProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QStringList value, QString toolTip)
void appendValue(double val)
void setValue(QcepPolygon val, int index)
void setValue(QcepDoubleVector val, int index)
void appendValue(double val)
QcepDoublePointProperty * m_Property
QString parentName() const
QDateTime defaultValue() const
QVector< double > QcepDoubleVector
void setSubValue(int axis, double value, int index)
QCEP_DOC_OBJECT("JSON","Qt Built-in JSON Parser") QCEP_DOC_FUNCTION("JSON.parse"
QcepDoubleProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, double value, QString toolTip)
QString toString(const QcepDoubleList &list)
#define INVOKE_CHECK(res)
void valueChanged(QByteArray val, int index)
void setDefaultValue(double val)
QcepDateTimeProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QDateTime value, QString toolTip)
QcepStringPropertyComboBoxHelper(QComboBox *comboBox, QcepStringProperty *property)
void setValue(QcepDoubleList val, int index)
qint64 defaultValue() const
QcepDoubleVector m_Default
QcepDoubleVector value() const
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
static void writeSettings(QObject *object, QSettings *settings, QString section)
void valueChanged(QStringList val, int index)
void subValueChanged(int axis, double value, int index)
void setValue(bool val, int index)
void incValue(qint64 step)
QcepDoubleList defaultValue() const
QList< QString > QcepStringList
void incValue(double step)
void textEdited(QString value, int index)
void linkTo(QComboBox *comboBox)
void setDefaultValue(QStringList val)
QcepStringProperty * m_Property
void valueChanged(QcepIntList val, int index)
QcepIntListProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepIntList value, QString toolTip)
QcepDoubleList value() const
void valueChanged(int value, int index)
static void customSaver(const QVariant &val, QSettings *settings, QString name)
void setDefaultValue(QByteArray val)
QcepIntProperty * m_Property
void setDefaultValue(QcepPolygon val)
QList< double > QcepDoubleList
QcepIntVector defaultValue() const
void linkTo(QSpinBox *spinBox)
QString toString(const QByteArray &list)
void valueChanged(QRectF val, int index)
QcepIntPropertySpinBoxHelper(QSpinBox *spinBox, QcepIntProperty *property)
void subValueChanged(int axis, double val, int index)
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
QcepDoublePointPropertyDoubleSpinBoxHelper(QDoubleSpinBox *spinBox, QcepDoublePointProperty *property, int axis)
QString toString(const QcepIntList &list)
void setValue(qint64 val, int index)
QVector< QString > QcepStringVector
QcepProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString toolTip)
QcepIntPropertyComboBoxHelper(QComboBox *comboBox, QcepIntProperty *property)
void valueChanged(QString value, int index)
void setDefaultValue(QcepDoubleList val)
void setCurrentIndex(int value, int index)
QcepByteArrayProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QByteArray value, QString toolTip)
void valueChanged(qint64 val, int index)
QcepStringProperty * m_Property
QString toString(const QcepIntVector &list)
QcepIntVector value() const
QcepStringProperty * m_Property
QString toString(const QStringList &list)
QcepDoubleRectProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QRectF value, QString toolTip)
QStringList defaultValue() const
QDoubleSpinBox * m_DoubleSpinBox
double subValue(int axis) const
void stringValueChanged(QString val)
void appendValue(QString val)
void valueChanged(QcepDoubleVector val, int index)
QVector< QPointF > QcepPolygon
static void setSettingsValue(QSettings *settings, QString name, QVariant value)
#define CONNECT_CHECK(res)
void valueChanged(double value, int index)
void setDefaultValue(QcepDoubleVector val)
void setValue(QPointF val, int index)
QcepDoublePointProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QPointF value, QString toolTip)
static QMap< QString, CustomSettingsSaver * > m_CustomSavers
QString toString(const QcepDoubleVector &list)
void setValue(int value, int index)
void valueChanged(double val, int index)
void valueChanged(QcepIntVector val, int index)
QStringList value() const
void incValue(QcepIntList step)
void appendValue(int val)
void appendValue(int val)
QString defaultValue() const
bool defaultValue() const
QcepStringProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QString value, QString toolTip)
void valueChanged(QPointF val, int index)
void valueChanged(int val, int index)
QString expandedToolTip() const
static void registerCustomSaver(QString typeName, CustomSettingsSaver *saver)
void stringValueChanged(QString val)
QcepIntProperty * m_Property
void setDefaultValue(QcepIntVector val)
void( CustomSettingsSaver)(const QVariant &val, QSettings *settings, QString name)
QcepIntProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, int value, QString toolTip)
void setValue(QByteArray val, int index)
static void customSaver(const QVariant &val, QSettings *settings, QString name)
void valueChanged(bool val, int index)
QcepPolygonProperty(QcepSettingsSaverWPtr saver, QObject *parent, const char *name, QcepPolygon value, QString toolTip)
QWeakPointer< QcepSettingsSaver > QcepSettingsSaverWPtr
QcepSettingsSaverWPtr m_Saver
void setValue(QString val, int index)
void setToolTip(QString tip)
void valueChanged(QcepPolygon val, int index)
void setValue(double value, int index)