Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.12.0
Description
It seems that the enum class property works differently if the enum type was instatied in namespace or in QObject.
I haved created two analogous enums and the comparison in QML don't work if i use enum class that was declarated in namespace (with Q_NAMESPACE and Q_ENUM_NS) (see the attached application).
Additionally, if I remove Q_DECLARE_METATYPE(model::UserType) from ModelEnums.h i get the error: QMetaProperty::read: Unable to handle unregistered datatype 'model::UserType' for property 'User::userType' but in the documentation of Q_ENUM_NS i can read:
"Registered enumerations are automatically registered also to the Qt meta type system, making them known to QMetaType without the need to use Q_DECLARE_METATYPE()."
Attachments
Issue Links
- duplicates
-
QTBUG-71966 Enum type is returned as object instead of number
- Closed
- relates to
-
QTBUG-73360 Enum class with the same name as other enum class member don't work in QML
- Closed
-
QTBUG-73394 Name clash warning for enum class with the same named mebers
- Closed