Inheritance diagram for DzButton:
Enumerations | |
enum | ToggleState { Off, NoChange, On } |
enum | ToggleType { SingleShot, Toggle, Tristate } |
Properties | |
Boolean | autoRepeat |
Boolean | down |
Boolean | exclusiveToggle |
Boolean | on |
Pixmap | pixmap |
String | text |
Boolean | toggleButton |
ToggleState | toggleState |
ToggleType | toggleType |
Constructors | |
DzButton (DzWidget parent) | |
Methods | |
void | toggle () |
Signals | |
void | clicked () |
Signature: "clicked()" | |
void | pressed () |
Signature: "pressed()" | |
void | released () |
Signature: "released()" | |
void | stateChanged (Number state) |
Signature: "stateChanged(int)" | |
void | toggled (Boolean onOff) |
Signature: "toggled(bool)" |
If you want to create a button use DzPushButton.
The DzButton class implements an abstract button, and lets subclasses (DzPushButton / DzCheckBox / DzRadioButton) specify how to reply to user actions and how to draw the button.
DzPushButton provides both push and toggle buttons. The DzRadioButton and DzCheckBox classes provide only toggle buttons.
The difference between down and on is, when a user clicks a [toggle] button to toggle it on, the button is first pressed and then released into the On state (on is true
, down is false
). When the user clicks it again (to toggle it off), the button is first pressed and then released to the Off state (on and down are false
).
enum DzButton::ToggleType |
DzButton::DzButton | ( | DzWidget | parent | ) |
Creates a button as a child of the given parent widget
void DzButton::clicked | ( | ) | [signal] |
void DzButton::pressed | ( | ) | [signal] |
void DzButton::released | ( | ) | [signal] |
void DzButton::stateChanged | ( | Number | state | ) | [signal] |
Signature: "stateChanged(int)"
Emitted when the ToggleState of the button is changed.
void DzButton::toggle | ( | ) |
Toggles the state of a toggle button.
void DzButton::toggled | ( | Boolean | onOff | ) | [signal] |
Signature: "toggled(bool)"
Emitted when the button is toggled. onOff
is true if the button is on, false if the button is off
bool DzButton::autoRepeat |
const QPixmap * DzButton::pixmap |
QString DzButton::text |
The text displayed on the button. undefined by default. An ampersand (&) in the String automacitally creates an accelerator for it using the character that follows the ampersand, as the accelerator key. Any previous accelerator will be overwritten, or cleared if no accelerator is defined by the text.
Whether the button is a toggle (read-only). false
by default.