【发布时间】:2015-03-06 13:39:10
【问题描述】:
我在 QtCreator 3.3.1 中使用 Qt 5.4.1
我已将 QtQuick.Controls 1.2 导入我的 QML 并添加了一系列按钮:
Rectangle {
id: buttonBar
x: 480
y: 0
width: 320
height: 80
Button {
x: 0
y: 0
width: 80
height: 60
text: "Songs"
}
Button {
x: 80
y: 0
width: 80
height: 60
text: "Artists"
}
Button {
x: 160
y: 0
width: 80
height: 60
text: "Albums"
}
Button {
x: 240
y: 0
width: 80
height: 60
text: "Back"
}
}
当我运行程序时它们都渲染得很好,但是每次 QtCreator 打开 qml 文件时它都会跳转到设计模式并且我收到警告:
invalid property name 'x' (M16)
当我在编辑模式下查看文件时,我使用 x、y、宽度和高度的行都带有下划线。
但文档说这些是我的按钮的有效属性 - http://doc.qt.io/qt-5/qml-qtquick-controls-button-members.html
如何停止/解决此错误消息?
【问题讨论】: