AbstractButton QML Type | Qt Labs Controls 5.6

Qt 5.6 | Qt Labs Controls | QML Types | AbstractButton QML Type

Qt 5.6.2 Reference Documentation

# AbstractButton QML Type

The base of all button controls. More...

Import Statement: | import Qt.labs.controls 1.0
Inherits: | Control
Inherited By: | Button, CheckBox, ItemDelegate, RadioButton, Switch, and TabButton

- List of all members, including inherited members

## Properties

- autoExclusive : bool
- autoRepeat : bool
- checkable : bool
- checked : bool
- highlighted : bool
- indicator : Item
- label : Item
- pressed : bool
- text : string

## Signals

- void canceled()
- void clicked()
- void doubleClicked()
- void pressAndHold()
- void pressed()
- void released()

## Detailed Description

AbstractButton provides the interface for controls with button-like behavior; for example, push buttons and checkable controls like radio buttons and check boxes. As an abstract control, it has no delegate implementations, leaving them to the types that derive from it.

TODO: ButtonGroup usage

Note: Types in the Qt.labs module are not guaranteed to remain compatible in future versions.

## Property Documentation

autoExclusive : bool

This property holds whether auto-exclusivity is enabled.

If auto-exclusivity is enabled, checkable buttons that belong to the same parent item behave as if they were part of the same ButtonGroup. Only one button can be checked at any time; checking another button automatically unchecks the previously checked one.

Note: The property has no effect on buttons that belong to an ButtonGroup.

RadioButton and TabButton are auto-exclusive by default.

autoRepeat : bool

This property holds whether the button repeats pressed(), released() and clicked() signals while the button is pressed and held down.

The default value is `false`.

checkable : bool

This property holds whether the button is checkable.

checked : bool

This property holds whether the button is checked.

highlighted : bool

This property holds whether the button is highlighted.

A button can be highlighted in order to draw the user's attention towards it. It has no effect on keyboard interaction.

The default value is `false`.

indicator : Item

This property holds the indicator item.

label : Item

This property holds the label item.

See also text.

pressed : bool

This property holds whether the button is pressed.

text : string

This property holds a textual description of the button.

Note: The text is used for accessibility purposes, so it makes sense to set a textual description even if the label item is an image.

See also label.

## Signal Documentation

void canceled()

This signal is emitted when the button loses mouse grab while being pressed, or when it would emit the released signal but the mouse cursor is not inside the button.

void clicked()

This signal is emitted when the button is interactively clicked by the user.

void doubleClicked()

This signal is emitted when the button is interactively double clicked by the user.

void pressAndHold()

This signal is emitted when the button is interactively perssed and held down by the user.

void pressed()

This signal is emitted when the button is interactively pressed by the user.

void released()

This signal is emitted when the button is interactively released by the user.