Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.2.11, 6.5.4, 6.6.2, 6.7.0 Beta3
-
82d546611 (dev), cb494c2e0 (6.7), 7da544e86 (dev), 806af3541 (6.7), 65fa7ff2c (6.6), e28fee2d2 (tqtc/lts-6.5), 38e35c2dd (tqtc/lts-6.2), ff024d653 (tqtc/lts-6.2)
Description
If I have C++ code like this:
namespace aaa::Data { Q_NAMESPACE QML_NAMED_ELEMENT(Data) QML_UNCREATABLE("C++ namespace") Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") enum class DType : uint8_t { A, B }; Q_ENUM_NS(DType) }
then I can use "DType" enum in QML like this:
Item {
property int secret: Data.DType.A
}
If I tried to use "Data.A" instead of "Data.DType.A":
Item {
property int secret: Data.A
}
I got warning during running the application: "Unable to assign [undefined] to int" .
But qmllint produces no warning about "property int secret: Data.A".
While usage of "Data.Foo" force it produce warning.
I suppose this is because of "qmltypes" generated by build system (I use cmake + qt_add_qml_module) do not distinguish between cases when RegisterEnumClassesUnscoped = true and = false.
It would be nice if qmllint also produces warning like "Unable to assign [undefined] to int"
Attachments
Issue Links
- relates to
-
QTBUG-116057 Enums annotated as scoped-only match unscoped with QML_SINGLETON
- Closed
- resulted in
-
QTBUG-127308 [REG 6.6 → 6.8] qmlRestrictedType warning errorneously triggers for enum class
- Closed
For Gerrit Dashboard: QTBUG-107143 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
437538,4 | Introduce scoped property into qmltypes/enum | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
541667,3 | qmltyperegistrar: Recognize more number types | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
541680,6 | QmlCompiler: Respect scoped enums | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
543329,2 | qmltyperegistrar: Recognize more number types | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
544336,2 | QmlCompiler: Respect scoped enums | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
544402,6 | QmlCompiler: Respect scoped enums | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
549621,3 | QmlCompiler: Respect scoped enums | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
550284,3 | QmlCompiler: Respect scoped enums | tqtc/lts-6.2 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
551309,2 | Respect scoped enums | tqtc/lts-6.2 | qt/tqtc-qmlcompilerplus | Status: MERGED | +2 | 0 |