이 페이지에서

해결되지 않은 별칭

qmllint에서는 이 경고 범주를 ‘ [unresolved-alias] ’로 표기합니다.

해결되지 않은 별칭

무슨 일이 발생했나요?

속성 별칭은 다른 속성에 대한 참조를 포함해야 합니다. QML 객체 속성 - 속성 별칭도 참조하십시오. 이 경우, 발견되지 않은 속성에 대한 참조를 포함하고 있습니다.

왜 문제가 될까요?

해결되지 않은 별칭이 있는 컴포넌트의 인스턴스는 런타임에 생성되지 않고, 대신 null이 됩니다.

예시

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
}

이 경고를 해결하려면, 별칭 속성의 id와 property가 실제로 존재하는지 확인하십시오:

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.