Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.4.0
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"