QML语法
QML 是一种用户界面规范和编程语言。它允许开发人员和设计人员创建性能高、动画流畅、视觉效果好的应用程序。QML 提供高度可读、声明式、类似 JSON 的语法,支持与动态属性绑定相结合的 JavaScript 表达式。
- color: "red", "green", "blue"
- SVG颜色
- color: "#RRGGBB"
- color: "#AARRGGBB"
- font.family: "Helvetica"
- font.bold: true
- font.italic: true
- font.underline: true
- font.pointSize: 10
- font.pixelSize: 10
- anchors.fill
- anchors.baseline
- anchors.baselineOffset
- anchors.left
- anchors.right
- anchors.top
- anchors.bottom
- anchors.margin
- anchors.leftMargin
- anchors.rightMargin
- anchors.topMargin
- anchors.bottomMargin
- anchors.centerIn
- anchors.verticalCenter
- anchors.horizontalCenter
- anchors.verticalCenterOffset
- anchors.horizontalCenterOffset
- alignment
- Qt.AlignVCenter
- Qt.AlignHCenter
- Qt.AlignLeft
- Qt.AlignRight
- Qt.AlignTop
- Qt.AlignButton
- Qt.AlignBaseline
- bottomMargin
- leftMargin
- rightMargin
- topMargin
- fillWidth: true
- fillHeight: true
- rows
- colums
- rowSpacing
- columnSpacing
- width: 100
- height: 100
- color: "red"
- border.width: 5
- border.color: "red"
- radius: 10
- text: "Hello"
- color: "red"
- font.bold: true
- font.family: ""
- font.italic: true
- font.pixelSize: 10
- font.pointSize: 10
- font.underline: true
- text: "OK"
- onClicked: model.submit()
- cursorShape 光标形状
- Qt.ArrowCurse
- Qt.CrossCursor
- Qt.OpenHandCursor
- onClicked: {}
- onPressed: {}
- onReleased: {}
- onPressAndHold: {}
- source: "/images/car.png"