QPushButton
The push button, or command button, is perhaps the most commonly used widget in any graphical user interface. Push (click) a button to command the computer to perform some action, or to answer a question. Typical buttons are OK, Apply, Cancel, Close, Yes, No and Help.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str
|
The text to display on the button. |
None
|
Signals
clicked
: Emitted when the button is clicked.
Methods
Examples
'Click me!'
'Don't click me!'
text()
Returns the text displayed in the button.
Returns:
Type | Description |
---|---|
str
|
The text displayed in the button. |
setText(text)
Sets the text to be displayed in the button.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str
|
The text to display in the button. |
required |