From 763a5f1b8c8be50b1614d30ee39f96825c3a285a Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Thu, 11 Jul 2024 10:57:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=208.1.=20=E5=A4=9A=20QML=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E7=AE=A1=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- .../Environment/Qt/QML/QML_应用程序开发技术总结.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Software/Development/Environment/Qt/QML/QML_应用程序开发技术总结.md b/Software/Development/Environment/Qt/QML/QML_应用程序开发技术总结.md index 4946b54..b4f2301 100644 --- a/Software/Development/Environment/Qt/QML/QML_应用程序开发技术总结.md +++ b/Software/Development/Environment/Qt/QML/QML_应用程序开发技术总结.md @@ -905,20 +905,20 @@ resources.files = main.qml resources.prefix = /$${TARGET} ``` -当我们向工程增加自定义 QML 文件时,会被增加到 DISTFILES 字段,比如: +当使用 QtCreator 新建文件向导向工程增加自定义 QML 文件时,QML 文件可能会被错误的增加到 DISTFILES 字段,比如: ```js DISTFILES += \ Demo.qml ``` -这会导致无法将 Demo.qml 加如到系统自建的 .qrc 文件中,此时会报: +此时编译程序会报: ```js failed to load component ... is not a type ``` -错误,此时需要手动添加 Demo.qml 到 resources.files 字段中。 +错误。解决方法是:手动修改 Demo.qml 到 resources.files 字段中即可。 ### 8.2. 如何引用自定义 QML 文件