Enum declared outside the root element

[non-root-enum] An enum was declared outside the root element.

This warning category is spelled [non-root-enum] by qmllint.

Enum declared outside the root element

What happened?

An enum was declared outside of the root element of the component.

Why is that bad?

It won’t be accessible. Enums are accessed as <component name>.<optional enum name>.<enum entry>. If the enum is not at the root of the component, this lookup won’t work.

Example

To fix this warning, move the enum to the root of the component: