해결되지 않은 별칭

이 경고 범주의 철자는 [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와 속성이 실제로 존재하는지 확인하세요:

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
}

© 2025 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.