Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
6.3
-
None
-
-
05f56d7c78754855c643470ad4e8dfd35c96f927
Description
I'm unable to use Q_GADGET + QML_VALUE_TYPE to declare a type with and enum exported to QML. At runtime I get this warning:
ReferenceError: lowercaseTypeName is not defined for value types
C++ code:
struct LowercaseTypeName
{{{}}
Q_GADGET
QML_VALUE_TYPE(lowercaseTypeName)
enum Foo
{
BAR1,
BAR2
};
Q_ENUM(Foo)
};
QML code:
property int value: 0
property bool is_bar1: value === lowercaseTypeName.BAR1
If I use QML_ELEMENT + QML_UNCREATABLE instead of QML_VALUE_TYPE then I get a different warning:
value type names should begin with a lowercase letter
Inheriting from QObject and using Q_OBJECT works OK.
The project uses QML modules in case it matters.