이름이 변경된 유형
qmllint에서는 이 경고 범주를 ‘ [renamed-type] ’로 표기합니다.
이름이 변경된 유형
무슨 일이 있었나요?
QT_QML_SOURCE_TYPENAME 또는 수동으로 작성된 qmldir을 통해 이름이 변경된 타입이, 내보내지 않은 이름으로 호출되었습니다.
왜 문제가 될까요?
이로 인해 단일 타입에 여러 개의 이름이 존재하게 되어 코드가 혼란스러워집니다. 이름이 변경된 싱글톤은 내보내지 않은 이름을 사용할 경우 올바르게 작동하지 않으며, 내보내지 않은 이름은 현재 QML 모듈 외부의 QML 파일에서는 사용할 수 없습니다.
예시
# CMakeLists.txt
set_source_files_properties(Tree.qml PROPERTIES QT_QML_SOURCE_TYPENAME BinaryTree)
qt_add_qml_module(MyModule
URI MyModule
QML_FILES Tree.qml
)// Tree.qml
import QtQml
Item {
property Tree left // uses old name - not ok
property Tree right // uses old name - not ok
}이 경고를 해결하려면 기존 이름을 새 이름으로 바꾸십시오:
// Tree.qml
import QtQml
Item {
property BinaryTree left // uses new name - ok
property BinaryTree right // uses new name - ok
}© 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.