Previously I posted a question on how to access structures in QML and got perfect answers from some awesome people and now i need to know is there any way to access structure inside a structure in QML, Following is the code :
//MyNewStruct
struct MyNewStruct {
Q_GADGET
float m_range;
Q_PROPERTY(float range MEMBER m_range)
};
//MyStruct
struct MyStruct {
Q_GADGET
int m_val;
QString m_name1;
QString m_name2;
QString m_name3;
QString m_name4;
MyNewStruct m_newStr; //**new Struct declaration
Q_PROPERTY(int val MEMBER m_val)
Q_PROPERTY(QString name1 MEMBER m_name1)
Q_PROPERTY(QString name2 MEMBER m_name2)
Q_PROPERTY(QString name3 MEMBER m_name3)
Q_PROPERTY(QString name4 MEMBER m_name4)
Q_PROPERTY(MyNewStruct newStr MEMBER m_newStr) //**Currently getting error as != cannot be used
};
error: no match for 'operator!=' (operand types are 'myStruct1' and 'myStruct1') if (_t->mynewstr != *reinterpret_cast< myStruct1*>(_v)) {
^ where Mystruct1 is myNewStruct – Halliehallmanreinterpret_cast
? I thought there are almost no cases where this cast is necessary... But as I said, I am just learning C++ right now ;-) – Afterglow