This warning category is spelled [restricted-type] by qmllint.
You accessed the value of an enum defined in C++ by its enum type name.
Unscoped enums defined in C++ can't be accessed by their enum type name. They will be undefined at runtime.
import QtQuick import SomeModule // contains MyClass Item { property int i: MyClass.Hello.World }
where MyClass is defined as
class MyClass: public QObject { Q_OBJECT QML_ELEMENT public: enum Hello { World }; Q_ENUM(Hello); ... };
To fix this warning, remove the unnecessary enum type name from its QML usage:
import QtQuick Item { property int i: MyClass.World }
If you are the author of the enum, you can also modify the enum definition to use an enum class instead of changing the QML code:
class MyClass: public QObject { Q_OBJECT QML_ELEMENT public: enum class Hello { World }; Q_ENUM(Hello); ... };
Note: You can find more information about enum type registration here.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: