C

AbstractButton QML Type

Abstract base type providing functionality common to buttons. More...

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

Control

Inherited By:

Button, CheckBox, RadioButton, and Switch

Properties

Signals

Methods

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.

See also Controls Styling and Button Controls.

Property Documentation

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.

The initial delay and the repetition interval are defined in milliseconds by autoRepeatDelay and autoRepeatInterval.


autoRepeatDelay : int

This property holds the initial delay of auto-repetition in milliseconds. The default value is 300 ms.

See also autoRepeat and autoRepeatInterval.


autoRepeatInterval : int

This property holds the interval of auto-repetition in milliseconds. The default value is 100 ms.

See also autoRepeat and autoRepeatDelay.


checkable : bool

This property holds whether the button is checkable.

A checkable button toggles between checked (on) and unchecked (off) when the user clicks on it.

Setting checked to true forces this property to true.

The default value is false.

See also checked.


checked : bool

This property holds whether the button is checked.

See also checkable.


down : bool

This property holds whether the button is visually down.

Unless explicitly set, this property follows the value of pressed.

Note: Qt Quick difference: Restoring the original behavior by assigning undefined to down is not supported.

See also pressed.


indicator : Item

This property holds the indicator item.


[read-only] pressed : bool

This property holds whether the button is physically pressed. A button can be pressed by touch or mouse.

See also down.


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 content item is an image.

See also contentItem.


Signal Documentation

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 outside the button's bounding rect.

Note: The corresponding handler is onCanceled.


clicked()

This signal is emitted when the button is interactively clicked by the user via touch or mouse.

Note: The corresponding handler is onClicked.


pressed()

This signal is emitted when the button is interactively pressed by the user via touch or mouse.

Note: The corresponding handler is onPressed.


released()

This signal is emitted when the button is interactively released by the user via touch or mouse.

Note: The corresponding handler is onReleased.


toggled()

This signal is emitted when a checkable button is interactively toggled by the user via touch or mouse.

Note: The corresponding handler is onToggled.


Method Documentation

void toggle()

Toggles the checked state of the button.


Available under certain Qt licenses.
Find out more.