상속 순환
qmllint에서는 이 경고 범주를 ‘ [inheritance-cycle] ’라고 표기합니다.
컴포넌트가 상속 순환의 일부입니다
무슨 일이 발생했나요?
컴포넌트가 자신으로부터 직접 또는 간접적으로 상속받았습니다.
일반적으로 컴포넌트는 다른 컴포넌트로부터 속성, 메서드, 시그널 및 열거형을 상속받을 수 있습니다.
컴포넌트가 직접 또는 다른 기본 컴포넌트를 통해 간접적으로 자신을 상속하는 경우, 상속 순환이 형성됩니다. 이 경고는 현재 컴포넌트가 상속 순환 내에 있음을 나타냅니다. 예제를 참조하십시오.
이것이 왜 문제일까요?
상속 순환이 있는 컴포넌트는 런타임에 생성되지 않고 대신 null로 처리됩니다.
예시
import QtQuick
Item {
component Cycle: Cycle {} // not ok: directly inherits from itself
component C: C2 {} // not ok: indirectly inherits from itself
component C2: C{}
}이 경고를 해결하려면 상속 순환을 끊으십시오:
© 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.