Skip to content

PythonQt.QtGui.QPushButton · declarations 001

Back to PythonQt.QtGui.QPushButton

autoDefault instance-attribute

autoDefault: bool

Qt 5 reference:

autoDefault : bool

This property holds whether the push button is an auto default button

If this property is set to true then the push button is an auto default button.

In some GUI styles a default button is drawn with an extra frame around it, up to 3 pixels or more. Qt automatically keeps this space free around auto-default buttons, i.e., auto-default buttons may have a slightly larger size hint.

This property's default is true for buttons that have a QDialog parent; otherwise it defaults to false.

See the default property for details of how default and auto-default interact.

Access functions:

bool autoDefault() const
void setAutoDefault(bool)

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#autoDefault

clicked

clicked(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.clicked; argument details are not documented.

customContextMenuRequested

customContextMenuRequested(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.customContextMenuRequested; argument details are not documented.

default instance-attribute

default: Any

Qt 5 reference:

default : bool

This property holds whether the push button is the default button

Default and autodefault buttons decide what happens when the user presses enter in a dialog.

A button with this property set to true (i.e., the dialog's default button,) will automatically be pressed when the user presses enter, with one exception: if an autoDefault button currently has focus, the autoDefault button is pressed. When the dialog has autoDefault buttons but no default button, pressing enter will press either the autoDefault button that currently has focus, or if no button has focus, the next autoDefault button in the focus chain.

In a dialog, only one push button at a time can be the default button. This button is then displayed with an additional frame (depending on the GUI style).

The default button behavior is provided only in dialogs. Buttons can always be clicked from the keyboard by pressing Spacebar when the button has focus.

If the default property is set to false on the current default button while the dialog is visible, a new default will automatically be assigned the next time a push button in the dialog receives focus.

This property's default is false.

Access functions:

bool isDefault() const
void setDefault(bool)

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#default

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.destroyed; argument details are not documented.

event

event(e: Any) -> bool

X.event(e) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QPushButton::event(QEvent *e)

Reimplements: QAbstractButton::event(QEvent *e).

Upstream PySide2 reference signatures (binding differences may apply):

event(self, e: PySide2.QtCore.QEvent) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#event

flat instance-attribute

flat: Any

Qt 5 reference:

flat : bool

This property holds whether the button border is raised

This property's default is false. If this property is set, most styles will not paint the button background unless the button is being pressed. setAutoFillBackground() can be used to ensure that the background is filled using the QPalette::Button brush.

Access functions:

bool isFlat() const
void setFlat(bool)

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#flat

focusInEvent

focusInEvent(arg__1: Any) -> None

X.focusInEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPushButton::focusInEvent(QFocusEvent *e)

Reimplements: QAbstractButton::focusInEvent(QFocusEvent *e).

Upstream PySide2 reference signatures (binding differences may apply):

focusInEvent(self, arg__1: PySide2.QtGui.QFocusEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#focusInEvent

focusOutEvent

focusOutEvent(arg__1: Any) -> None

X.focusOutEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPushButton::focusOutEvent(QFocusEvent *e)

Reimplements: QAbstractButton::focusOutEvent(QFocusEvent *e).

Upstream PySide2 reference signatures (binding differences may apply):

focusOutEvent(self, arg__1: PySide2.QtGui.QFocusEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#focusOutEvent

hitButton

hitButton(pos: Any) -> bool

X.hitButton(pos) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual protected] bool QPushButton::hitButton(const QPoint \&pos) const

Reimplements: QAbstractButton::hitButton(const QPoint \&pos) const.

Upstream PySide2 reference signatures (binding differences may apply):

hitButton(self, pos: PySide2.QtCore.QPoint) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#hitButton

initStyleOption

initStyleOption(option: Any) -> None

X.initStyleOption(option)

Supplemental documentation: Qt 5 reference:

[protected] void QPushButton::initStyleOption(QStyleOptionButton *option) const

Initialize option with the values from this QPushButton. This method is useful for subclasses when they need a QStyleOptionButton, but don't want to fill in all the information themselves.

See also QStyleOption::initFrom().

Upstream PySide2 reference signatures (binding differences may apply):

initStyleOption(self, option: PySide2.QtWidgets.QStyleOptionButton) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#initStyleOption

isDefault

isDefault() -> bool

X.isDefault() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isDefault(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#isDefault

isFlat

isFlat() -> bool

X.isFlat() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isFlat(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#isFlat

keyPressEvent

keyPressEvent(arg__1: Any) -> None

X.keyPressEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPushButton::keyPressEvent(QKeyEvent *e)

Reimplements: QAbstractButton::keyPressEvent(QKeyEvent *e).

Upstream PySide2 reference signatures (binding differences may apply):

keyPressEvent(self, arg__1: PySide2.QtGui.QKeyEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#keyPressEvent

menu

menu() -> Any

X.menu() -> PythonQt.QtGui.QMenu

Supplemental documentation: Qt 5 reference:

QMenu *QPushButton::menu() const

Returns the button's associated popup menu or nullptr if no popup menu has been set.

See also setMenu().

Upstream PySide2 reference signatures (binding differences may apply):

menu(self) -> PySide2.QtWidgets.QMenu

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#menu

minimumSizeHint instance-attribute

minimumSizeHint: QSize

Qt 5 reference:

[override virtual] QSize QPushButton::minimumSizeHint() const

Reimplements an access function for property: QWidget::minimumSizeHint.

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#minimumSizeHint

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.objectNameChanged; argument details are not documented.

paintEvent

paintEvent(arg__1: Any) -> None

X.paintEvent(arg__1)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QPushButton::paintEvent(QPaintEvent *)

Reimplements: QAbstractButton::paintEvent(QPaintEvent *e).

Upstream PySide2 reference signatures (binding differences may apply):

paintEvent(self, arg__1: PySide2.QtGui.QPaintEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#paintEvent

pressed

pressed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.pressed; argument details are not documented.

released

released(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.released; argument details are not documented.

setAutoDefault

setAutoDefault(arg__1: bool) -> None

X.setAutoDefault(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setAutoDefault(self, arg__1: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#setAutoDefault

setDefault

setDefault(arg__1: bool) -> None

X.setDefault(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setDefault(self, arg__1: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#setDefault

setFlat

setFlat(arg__1: bool) -> None

X.setFlat(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setFlat(self, arg__1: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#setFlat

setMenu

setMenu(menu: Any) -> None

X.setMenu(menu)

Supplemental documentation: Qt 5 reference:

void QPushButton::setMenu(QMenu *menu)

Associates the popup menu menu with this push button. This turns the button into a menu button, which in some styles will produce a small triangle to the right of the button's text.

Ownership of the menu is not transferred to the push button.

Screenshot of a Fusion style push button with popup
menu.

A push button with popup menus shown in the Fusion widget style.

See also menu().

Upstream PySide2 reference signatures (binding differences may apply):

setMenu(self, menu: PySide2.QtWidgets.QMenu) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#setMenu

showMenu

showMenu() -> None

X.showMenu()

Supplemental documentation: Qt 5 reference:

[slot] void QPushButton::showMenu()

Shows (pops up) the associated popup menu. If there is no such menu, this function does nothing. This function does not return until the popup menu has been closed by the user.

Upstream PySide2 reference signatures (binding differences may apply):

showMenu(self) -> None

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#showMenu

sizeHint instance-attribute

sizeHint: QSize

Qt 5 reference:

[override virtual] QSize QPushButton::sizeHint() const

Reimplements an access function for property: QWidget::sizeHint.

Source: https://doc.qt.io/archives/qt-5.15/qpushbutton.html#sizeHint

toggled

toggled(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.toggled; argument details are not documented.

windowIconChanged

windowIconChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.windowIconChanged; argument details are not documented.

windowIconTextChanged

windowIconTextChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.windowIconTextChanged; argument details are not documented.

windowTitleChanged

windowTitleChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QPushButton.windowTitleChanged; argument details are not documented.