I have created a custom type inheriting from QObject.
I have declared the type with Q_DECLARE_METATYPE() with qmlDeclareType() and also with qRegisterMetaType().
From another object declared as a component in QML I emit a signal which has the type as a parameter now when the signal is handled from the QML I cannot access any of the properties of the type.
In debug output while debugging
Error: Cannot assign [undefined] to QString
is shown whenever I try to access any property of the variable and
Error: <variableName> is not defined
is shown.
my signal is declared as follows:
and handled in qml as follows:Code:signals: void readTagBCard(const BCard& tagc);
the method is lastName is declared as follows:Code:onReadTagBCard:{ txtFullName.text = tagc.lastName; }
How can I access methods on custom type variables in QML?Code:QString lastName() const {return mlastName;};



