Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.4.1
-
None
Description
I put next class into qml context:
#include <QObject> namespace Node1984 { namespace Controller { class TaskDescriptorControllerScriptAPI : public QObject { Q_OBJECT public: explicit TaskDescriptorControllerScriptAPI( QObject *parent = 0 ); Q_INVOKABLE TaskDescriptorControllerScriptAPI* getFirstChildDescriptorController(); }; } // namespace Controller } // namespace Node1984
using this code in QML context gives me next error:
"Error: Unknown method return type: TaskDescriptorControllerScriptAPI*"
after few days of debugging I found that next code generate correct class
#include <QObject> namespace Node1984 { namespace Controller { class TaskDescriptorControllerScriptAPI : public QObject { Q_OBJECT public: explicit TaskDescriptorControllerScriptAPI( QObject *parent = 0 ); Q_INVOKABLE Node1984::Controller::TaskDescriptorControllerScriptAPI* getFirstChildDescriptorController(); }; } // namespace Controller } // namespace Node1984
seems that Q_INVOKABLE can`t use class without explicit specifying namespace.
Probably this relates to old problem described also here http://stackoverflow.com/questions/14086289/use-c-slot-in-qml-which-returns-type-in-namespace