별칭 순환
qmllint에서는 이 경고 범주를 ‘ [alias-cycle] ’로 표기합니다.
별칭 속성이 별칭 순환의 일부입니다
무슨 일이 발생했나요?
속성 별칭이 자기 자신이나, 자기 자신으로 해결되는 다른 별칭으로 해결됩니다.
일반적으로 속성 별칭은 다른 속성을 직접 참조하거나, 다른 별칭 속성을 경유하여 간접적으로 참조해야 합니다.
속성 별칭이 직접 또는 간접적으로 자신을 참조하는 경우, 별칭 순환이 형성됩니다. 이 경고는 현재 별칭 속성이 별칭 순환 내에 있거나 이를 참조하고 있음을 나타냅니다. 예제를 참조하십시오.
이것이 왜 문제일까요?
별칭 순환이 있는 컴포넌트의 인스턴스는 런타임에 생성되지 않고, 대신 null이 됩니다.
예제
import QtQuick
Item {
id: someId
property alias myself: someId.myself // not ok: referring to itself
property alias cycle: someId.cycle2 // not ok: indirectly referring to itself
property alias cycle2: someId.cycle
property alias indirect: someId.cycle // not ok: referring to alias indirectly referring to itself
}이 경고를 해결하려면 별칭 순환을 끊으십시오:
import QtQuick
Item {
id: someId
Item {
id: anotherId
property string myself
property int cycle
}
property alias myself: anotherId.myself // ok: referring to a property
property alias cycle: someId.cycle2 // ok: does not refer to itself anymore
property alias cycle2: anotherId.cycle // ok: not a cycle anymore
property alias indirect: someId.cycle // ok: cycle does not form an alias cycle anymore
}© 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.