We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1.QML 中的 Button 和 QPushButton 类似,用户点击按钮会触发一个 clicked() 信号,在 QML 文档中可以为 clicked() 指定信号处理器,响应用户操作。
clicked()
2.要使用 Button ,需要引入 import QtQuick.Controls 1.1 。
import QtQuick.Controls 1.1
代码举例:
import QtQuick 2.0 import QtQuick.Controls 1.1 Rectangle { width: 300; height: 200; Button { anchors.centerIn: parent; text: "Quit"; onClicked: Qt.quit(); //处理点击事件 } }
There was an error while loading. Please reload this page.
[[TOC]]