|
|
@ -10,6 +10,9 @@
|
|
|
|
#include <QVariant>
|
|
|
|
#include <QVariant>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QComboBox>
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "../qdecimal/src/QDecDouble.hh"
|
|
|
|
|
|
|
|
|
|
|
|
#include "iform.h"
|
|
|
|
#include "iform.h"
|
|
|
|
#include "service.h"
|
|
|
|
#include "service.h"
|
|
|
@ -77,7 +80,15 @@ private:
|
|
|
|
registerCombos();
|
|
|
|
registerCombos();
|
|
|
|
foreach (QWidget *widget, m_bindWidgets) {
|
|
|
|
foreach (QWidget *widget, m_bindWidgets) {
|
|
|
|
const char* prop = widget->metaObject()->userProperty().name();
|
|
|
|
const char* prop = widget->metaObject()->userProperty().name();
|
|
|
|
widget->setProperty(prop, ((QObject*)m_entity.data())->property(widget->objectName().toStdString().c_str()));
|
|
|
|
QVariant value = ((QObject*)m_entity.data())->property(widget->objectName().toStdString().c_str());
|
|
|
|
|
|
|
|
if (value.canConvert<QDecDouble>())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
widget->setProperty(prop, value.value<QDecDouble>().toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
widget->setProperty(prop, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach (QComboBox *combo, m_bindCombos.keys()) {
|
|
|
|
foreach (QComboBox *combo, m_bindCombos.keys()) {
|
|
|
@ -117,7 +128,14 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
foreach (QWidget *widget, m_bindWidgets) {
|
|
|
|
foreach (QWidget *widget, m_bindWidgets) {
|
|
|
|
const char* prop = widget->metaObject()->userProperty().name();
|
|
|
|
const char* prop = widget->metaObject()->userProperty().name();
|
|
|
|
((QObject*)m_entity.data())->setProperty(widget->objectName().toStdString().c_str(), widget->property(prop));
|
|
|
|
|
|
|
|
|
|
|
|
QVariant val = widget->property(prop);
|
|
|
|
|
|
|
|
if (((QObject*)m_entity.data())->property(widget->objectName().toStdString().c_str()).canConvert<QDecDouble>())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QDecDouble dec(val.toDouble());
|
|
|
|
|
|
|
|
val = QVariant::fromValue(dec);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
((QObject*)m_entity.data())->setProperty(widget->objectName().toStdString().c_str(), val);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach (QComboBox *combo, m_bindCombos.keys()) {
|
|
|
|
foreach (QComboBox *combo, m_bindCombos.keys()) {
|
|
|
|