修正 8.1. 多 QML 文件的管理。
Signed-off-by: rick.chan <cy@haoan119.com>
This commit is contained in:
parent
1993bae60b
commit
763a5f1b8c
|
@ -905,20 +905,20 @@ resources.files = main.qml
|
||||||
resources.prefix = /$${TARGET}
|
resources.prefix = /$${TARGET}
|
||||||
```
|
```
|
||||||
|
|
||||||
当我们向工程增加自定义 QML 文件时,会被增加到 DISTFILES 字段,比如:
|
当使用 QtCreator 新建文件向导向工程增加自定义 QML 文件时,QML 文件可能会被错误的增加到 DISTFILES 字段,比如:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
DISTFILES += \
|
DISTFILES += \
|
||||||
Demo.qml
|
Demo.qml
|
||||||
```
|
```
|
||||||
|
|
||||||
这会导致无法将 Demo.qml 加如到系统自建的 .qrc 文件中,此时会报:
|
此时编译程序会报:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
failed to load component ... is not a type
|
failed to load component ... is not a type
|
||||||
```
|
```
|
||||||
|
|
||||||
错误,此时需要手动添加 Demo.qml 到 resources.files 字段中。
|
错误。解决方法是:手动修改 Demo.qml 到 resources.files 字段中即可。
|
||||||
|
|
||||||
### 8.2. 如何引用自定义 QML 文件
|
### 8.2. 如何引用自定义 QML 文件
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue