Tipo renombrado
qmllint escribe esta categoría de advertencia como « [renamed-type] ».
Tipo renombrado
¿Qué ha ocurrido?
Se ha llamado a un tipo, cuyo nombre se había cambiado mediante QT_QML_SOURCE_TYPENAME o mediante un qmldir escrito a mano, por su nombre no exportado.
¿Por qué es un problema?
Esto da lugar a un código confuso, ya que un mismo tipo tiene ahora más de un nombre. Los singletons renombrados no funcionarán correctamente si se utiliza su nombre no exportado, y este nombre no puede ser utilizado por archivos QML fuera del módulo QML actual.
Ejemplo
# 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
}Para solucionar esta advertencia, sustituye el nombre antiguo por el nuevo:
// 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.