Button QML Type

Push-button that can be clicked to perform a command or answer a question. More...

Import Statement: import QtQuick.Controls
Since: Qt Quick Ultralite 1.0


Detailed Description

Button presents a push-button control that can be pushed or clicked by the user. Buttons are normally used to perform an action, or to answer a question. Typical buttons are OK, Apply, Cancel, Close, Yes, No, and Help.

Button inherits its API from AbstractButton. For instance, you can set text and react to clicks using the AbstractButton API.

A button emits the signal clicked() when it is activated by the user. Connect to this signal to perform the button's action. Buttons also provide the signals canceled(), pressed(), and released().

See the snippet below on how to connect to the button's signals.

Row {
    Button {
        text: "Ok"
        onClicked: model.submit()
    Button {
        text: "Cancel"
        onClicked: model.revert()

See also Controls Styling and Button Controls.

Available under certain Qt licenses.
Find out more.