Unsolved Registering custom type to use with qml/javascript
-
I have a custom class, i will name it MyClass here.
I registered one object of MyClass to the QmlEngine with setContextProperty
I can call all its methods that are Q_INVOKABLE, no problem.
One method(that is Q_INVOKABLE), that I will call get() returns an Object of MyClass.
I get the Error : Unknown Method return type : MyClass.
MyClass is registered with the macro QML_ELEMENT, Q_OBJECT, and inherit QObject.
I read the doc of course, but I can't figure out what I did wrong.Can someone with some experience in the matter tell me what's not right ?
Thanks !
-
Just for clarification.
Which Qt Version do you use 5.15.0 or below?
-
I use 5.15
-
I've posted the code in stackoverflow i you dont mind looking it up : https://stackoverflow.com/questions/62792225/register-custom-type-in-qt-with-qjsengine