Propriedade que não é uma lista
Essa categoria de aviso é denominada “ [non-list-property] ” pelo qmllint.
Não é possível atribuir vários objetos a uma propriedade padrão que não seja de lista
O que aconteceu?
Uma propriedade padrão possui múltiplas ligações, mas o tipo da propriedade padrão não é um tipo de lista e espera apenas uma ligação.
Por que isso é ruim?
Todas as ligações à propriedade padrão, exceto a última, serão ignoradas. Isso provavelmente indica que a propriedade padrão deveria, na verdade, ser uma lista, ou que há ligações demais para a mesma propriedade.
Exemplo
Vamos declarar um componente MyComponent que possui uma propriedade padrão que não é uma lista e, em seguida, vincular três itens a essa propriedade padrão:
import QtQuick
Item {
component MyComponent: QtObject {
default property Item helloWorld
}
MyComponent {
// first item bound to default property:
Item { objectName: "first" } // will warn: Cannot assign multiple objects to a default non-list property [non-list-property]
// second item bound to default property:
Item { objectName: "second" } // not ok: default property was bound already
// third item bound to default property:
Item { objectName: "third" } // not ok: default property was bound already
Component.onCompleted: console.log(helloWorld.objectName) // prints "third"
}
}Para corrigir esse aviso, substitua a propriedade padrão por uma lista:
import QtQuick
Item {
component MyComponent: QtObject {
default property list<Item> helloWorld
}
MyComponent {
// first item bound to default property:
Item { objectName: "first" } // ok: binding a first item to the list
// second item bound to default property:
Item { objectName: "second" } // ok: binding a second item to the list
// third item bound to default property:
Item { objectName: "third" } // ok: binding a third item to the list
}
}Para corrigir esse aviso, remova todas as ligações indesejadas, caso a propriedade padrão não deva ser uma lista:
import QtQuick
Item {
component MyComponent: QtObject {
default property Item helloWorld
}
MyComponent {
Item { objectName: "first" } // ok: just one item bound to default property
}
MyComponent {
Item { objectName: "second" } // ok: just one item bound to default property
}
MyComponent {
Item { objectName: "third" } // ok: just one item bound to default property
}
}© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.