이 페이지에서

최상위 컴포넌트

이 경고 범주는 qmllint에서 ' [top-level-component] '로 표기됩니다.

QML 최상위 유형은 Component일 수 없습니다

무슨 일이 발생했나요?

QML 파일의 최상위 유형으로 Component 유형을 사용했습니다.

이것이 왜 문제인가요?

QML 파일 자체에 이미 컴포넌트가 정의되어 있습니다. Component 유형을 최상위 유형으로 사용하면 컴포넌트가 불필요한 또 다른 컴포넌트로 감싸지게 됩니다.

예시

import QtQuick

Component {
    Item { ... }
}

이 경고를 해결하려면 불필요한 Component 감싸기를 제거하세요:

import QtQuick

Item { ... }

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