Non-list property¶
[non-list-property] Multiple values were assigned to a non-list property.
This warning category is spelled [non-list-property] by qmllint.
Cannot assign multiple objects to a default non-list property¶
What happened?¶
A default property has multiple bindings but the default property type is not a list type and only expects one binding.
Why is this bad?¶
All the bindings to the default property, except the last one, will be ignored. This most likely hints that the default property should instead be a list, or that there are too many bindings to the same property.
Example¶
Let’s declare a component MyComponent that has one default non-list property, and then lets bind three items to that default property:
To fix this warning, replace the default property by a list:
To fix this warning, remove all the unwanted bindings in case the default property is not supposed to be a list: