Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
6.4.3
-
None
Description
One method of exposing C++ enums to QML has been to use Q_GADGET in combination with qmlRegisterUncreatableType, e.g.:
class MyStatus
{
Q_GADGET
public:
enum Value
{
Off,
On,
Failed
};
Q_ENUM(Value)
...
This works fine with no errors in Qt 5.15.2.
However, when using Qt 6.4.3, it seems to work but you get the following runtime error in the console:
qt.qml.typeregistration: Invalid QML element name "MyStatus"; value type names should begin with a lowercase letter.
It is normal/recommended for enums and their elements to start with an upper-case letter.
Also, is there a new/recommended way of using an enum in both C++ and QML?