【Qt QML】Qt5.15.2 qml添加自定义控件报错“Xxxx is not a type“

  1. 清除构建,重新构建
  2. 修改*.pro文件
RESOURCES += qml.qrc xxx.qml #xxx.qml是新的控件

或

resource.files = main.qml xxx.qml
RESOURCES += resource

参考:

QML-自定义模块:https://blog.csdn.net/QtCompany/article/details/131215350

QML-自定义模块:https://mp.weixin.qq.com/s?__biz=Mzg2ODY5MDg4Ng==&mid=2247485551&idx=1&sn=416e5aeb1d745b3b2add38e68c08c0dd&chksm=cea936c6f9debfd0fdb774ef419bcb3484d41a61e13827493d1f996fbfd62485c020ce18f70a#rd

你可能感兴趣的:(QML,Qt,qt,开发语言)