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