이 페이지에서

Type이 재귀적으로 인스턴스화됩니다

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

타입을 재귀적으로 인스턴스화할 수 없습니다

무슨 일이 발생했나요?

컴포넌트가 스스로 인스턴스화되었습니다.

이것이 왜 문제인가요?

컴포넌트가 자신을 인스턴스화하기 위해 스스로가 필요하기 때문에 무한 루프가 발생합니다. QML Runtime은 이 컴포넌트에 대해 오류를 발생시킵니다.

예시

// MyComponent.qml
import QtQuick

Item {
    MyComponent {}
}

이 경고를 해결하려면,

  • 실수로 인한 것이라면 문제가 되는 컴포넌트를 다른 것으로 교체하십시오.
  • 예를 들어, JavaScript를 통한 동적 QML 객체 생성 방식을 사용하여 인스턴스화를 나중에 수행하도록 미루십시오.
// MyComponent.qml
import QtQuick

Item {
    // solution 1: MyComponent was not needed here, use another type
    Item {}

    // solution 2: add a MyComponent property and set it later
    property MyComponent myChild
}

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