Open HaonPAPA opened 2 years ago
In this case, cModelQuantitation_MeasureData must be inherited from QSerializer. Also, i don't tested non direct inherit with many base-classes. Maybe, Q_PROPERTY work not correctly in this case.
이 경우 cModelQuantitation_MeasureData는 QSerializer에서 상속되어야 합니다. 또한 많은 기본 클래스로 비 직접 상속을 테스트하지 않았습니다. 이 경우 Q_PROPERTY가 제대로 작동하지 않을 수 있습니다.
class cModelQuantitation_MeasureData : public cSerializer
{
Q_GADGET
QS_SERIALIZABLE
QS_FIELD(bool, IsChecked) // 체크박스 상태
QS_COLLECTION(QVector, qreal, vConc) // 농도
QS_COLLECTION(QVector, qreal, vTRA) // 투과율
QS_COLLECTION(QVector, qreal, vABS) // 흡광도
QS_COLLECTION(QVector, QString, vCellNumber) // 셀번호
QS_FIELD(QString, strSampleName) // 샘플명
QS_FIELD(double, strTemperature) // 온도
};
cModelQuantitation_MeasureData is also used by inheriting cSerializer. Any solution?
==========================================================
Fields in cModelStandardCurve get values normally. However, the contents of QS_COLLECTION and QS_OBJECT cannot be imported.
==========================================================
One thing I found is that the contents of metaObject()->property(i).name() come in as class variable names, not class names. If it comes in as a class name, it seems to be normal behavior.
==========================================================
if (name == "cSTC_MeasureData")
{
auto f = doc.firstChildElement("cModelStandardCurve_MeasureData");
if(!f.isNull())
metaObject()->property(i).writeOnGadget(this, QVariant::fromValue<QDomNode>(f));
}
else if (name == "cSTC_Reportopt")
{
auto f = doc.firstChildElement("cReportOption");
if (!f.isNull())
metaObject()->property(i).writeOnGadget(this, QVariant::fromValue<QDomNode>(f));
}
By modifying the else part of the fromXml function like this, it works normally. Is there any other way besides what I did? The method I'm doing now is a passive method.
hello thanks a lot for help In my case, I tested it, and it is confirmed that the file is written normally.
But in the process of getting the value with Get, I got an abnormal result.
This is the case with the class relationship diagram, what should I do to properly handle this case?
Fields of cModelCommon class are imported normally. However, the class object of cModelQuantitation gets the initial value.