Alias non risolto
Questa categoria di avviso viene indicata da qmllint con il nome " [unresolved-alias] ".
Alias non risolto
Cosa è successo?
Un alias di proprietà dovrebbe contenere un riferimento a un'altra proprietà; si veda anche Attributi degli oggetti QML - Alias di proprietà. In questo caso, contiene un riferimento a una proprietà che non è stata trovata.
Perché è un problema?
Le istanze dei componenti con alias non risolti non verranno create in fase di esecuzione: risulteranno invece nulle.
Esempio
import QtQuick
Item {
id: someId
property int helloWorld
property alias helloWorldAlias: helloWorld // not ok: aliases have to refer by id
property alias helloWorldAlias2: someId.helloWorlddd // not ok: no helloWorlddd in someId
property alias helloWorldAlias3: someIddd.helloWorld // not ok: someIddd does not exist
}Per risolvere questo avviso, assicurarsi che l’id e la proprietà dell’alias esistano effettivamente:
import QtQuick
Item {
id: someId
property int helloWorld
property alias helloWorldAlias: someId.helloWorld // ok: alias refers by id
property alias helloWorldAlias2: someId.helloWorld // ok: helloWorld does exist in someId
property alias helloWorldAlias3: someId.helloWorld // ok: someId does exist
}© 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.