Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.0 Beta 4
-
-
ae9be1a63d7b579fb5bb8b4bf903f1a3efe7168f
Description
The return value should return an enum value which can be used to compare it to the exposed enum constants.
But the return values are treated as objects and can not be compared to the integer constants:
// in C++ enum StatusCode { Good }; QtBugNamespace::StatusCode goodStatus() // returns an enum // in QML // QtBugImport.Constants.Good == 0 (number) // but object.goodStatus is "Good" (object)
This happens for QObject as well as Q_GADGET. Change https://codereview.qt-project.org/244514 was already applied on top of 5.12
When moving the namespace from ns.h into foo.h it suddenly works.
The example contains a QObject and a Q_GADGET with the same issue.
Attachments
Issue Links
- is duplicated by
-
QTBUG-73402 Problem with enum class from namespace used as QObject property
-
- Closed
-
- resulted from
-
QTBUG-72069 Q_NAMESPACE and Q_ENUM_NS behaviour is inconsistent
-
- Closed
-