Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.3
-
None
-
PC Ubuntu
Description
When declaring in the same class one enumeration, the corresponding Q_ENUMS, and a Q_INVOKABLE function with the enumeration in parameter, the function can be called from qml.
But if the enumeration comes from another class, the Q_INVOKABLE function cannot be called with the following error message:
"Error: Unknown method parameter type"
I read in the following page:
http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html#using-enumeration-values-as-signal-parameters
this requirement:
"C++ signals may pass enumeration values as signal parameters to QML, providing that the enumeration and the signal are declared within the same class, or that the enumeration value is one of those declared in the Qt Namespace."
I guess the same requirement applies for Q_INVOKABLE functions ? Can you document it as well ?
Is there a way to bypass this requirement ? I would like to share some enumerations in many classes.