Details
-
Task
-
Resolution: Done
-
Not Evaluated
-
None
-
None
-
None
Description
In the declarative module it is necessary to determine whether a typename from a signal parameter type refers to an enum, so that the parameter value can be passed to QML as an integer type rather than a wrapped QVariant type. Currently this is implemented by inspecting the meta object that emits the signal, to see if the typename matches an enum in the meta object; so, this solution won't work if the enum type is emitted from a signal outside of the class that declared the enum.
To implement a generic solution for enum types, there would need to be a way to determine whether a registered type is an enum. As discussed, one method would be to add functionality to automatically determine this from the use of Q_ENUMS and/or Q_DECLARE_METATYPE.
Attachments
Issue Links
- resulted from
-
QTBUG-15983 Cannot pass enum value as signal parameter from C++ to QML
- Closed