QM:无效的属性名称

时间:2021-07-03 17:41:49

标签: android qt qml

我使用 Qt Creator 4.15.1 版运行 Windows 10,如下图所示。enter image description here

我有一个在安装过程中自动检测到的 Android 套件,称为 Android Qt 5.15.0 Clang。当我创建 Qt Quick Application 时,我收到如下错误:

C:\Qt\5.15.0\android\mkspecs\features\android\android_deployment_settings.prf:78: 错误: contains(): 遇到无效的正则表达式 '.*\qmake_qmake_immediate.qrc$'。

这是我的 main.qml 文件中的代码:

import QtQuick 2.10
import QtQuick.Window 2.10


Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

}

对于在 Window 下定义的每个属性,我都会收到一个特定的错误,指出“无效的属性名称”。如果我选择不同的工具包(例如基于桌面的工具包),错误就会消失。

1 个答案:

答案 0 :(得分:1)

使用 ApplicationWindow 而不是 Window