Button QML Type
A push button with a text label. More...
Import Statement: | import QtQuick.Controls 1.3 |
Since: | Qt 5.1 |
Inherits: |
Properties
- action : Action
- activeFocusOnPress : bool
- checkable : bool
- checked : bool
- exclusiveGroup : ExclusiveGroup
- hovered : bool
- iconName : string
- iconSource : url
- isDefault : bool
- menu : Menu
- pressed : bool
- style : Component
- text : string
- tooltip : string
Signals
- clicked()
Detailed Description
The push button is perhaps the most commonly used widget in any graphical user interface. Pushing (or clicking) a button commands the computer to perform some action or answer a question. Common examples of buttons are OK, Apply, Cancel, Close, Yes, No, and Help buttons.
Button { text: "Button" }
Button is similar to the QPushButton widget.
You can create a custom appearance for a Button by assigning a ButtonStyle.
Property Documentation
action : Action |
This property holds the associated button action.
If a button has an action associated, the action defines the button's properties like checked, text, tooltip etc.
When an action is set, it's still possible to override the text, tooltip, iconSource, and iconName properties.
The default value is null
.
This property specifies whether the button should gain active focus when pressed.
The default value is false
.
This property holds whether the button is checked.
Only checkable buttons can be checked.
The default value is false
.
exclusiveGroup : ExclusiveGroup |
This property holds the ExclusiveGroup that the button belongs to.
The default value is null
.
The image label source as theme name. When an icon from the platform icon theme is found, this takes precedence over iconSource.
iconSource : url |
This property holds the icon shown on the button. If the button has no icon, the iconSource property will be an empty string.
The default value is the empty string.
This property holds whether the push button is the default button. Default buttons decide what happens when the user presses enter in a dialog without giving a button explicit focus.
Note: This property only changes the appearance of the button. The expected behavior needs to be implemented by the user.
The default value is false
.
menu : Menu |
Assign a Menu to this property to get a pull-down menu button.
The default value is null
.
style : Component |
The style Component for this control.
See also Qt Quick Controls Styles QML Types.
This property holds the text shown on the button. If the button has no text, the text property will be an empty string.
The default value is the empty string.
Signal Documentation
© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.