Skip to content

PythonQt.QtGui.QMessageBox · declarations 002

Back to PythonQt.QtGui.QMessageBox

question

question(parent: Any, title: str, text: str, buttons: Any, defaultButton: Any) -> Any

X.question(parent, title, text, buttons, defaultButton)

Supplemental documentation: Qt 5 reference:

[static] QMessageBox::StandardButton QMessageBox::question(QWidget *parent, const QString \&title, const QString \&text, QMessageBox::StandardButtons buttons \= StandardButtons(Yes | No), QMessageBox::StandardButton defaultButton \= NoButton)

Opens a question message box with the given title and text in front of the specified parent widget.

The standard buttons are added to the message box. defaultButton specifies the button used when Enter is pressed. defaultButton must refer to a button that was given in buttons. If defaultButton is QMessageBox::NoButton, QMessageBox chooses a suitable default automatically.

Returns the identity of the standard button that was clicked. If Esc was pressed instead, the escape button is returned.

The message box is an application modal dialog box.

Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.

This function was introduced in Qt 4.2.

See also information(), warning(), and critical().

Upstream PySide2 reference signatures (binding differences may apply):

question(parent: PySide2.QtWidgets.QWidget, title: str, text: str, button0: PySide2.QtWidgets.QMessageBox.StandardButton, button1: PySide2.QtWidgets.QMessageBox.StandardButton) -> int
question(parent: PySide2.QtWidgets.QWidget, title: str, text: str, buttons: PySide2.QtWidgets.QMessageBox.StandardButtons=..., defaultButton: PySide2.QtWidgets.QMessageBox.StandardButton=...) -> PySide2.QtWidgets.QMessageBox.StandardButton

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#question

rejected

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

Native PythonQt.QtGui.QMessageBox.rejected; argument details are not documented.

removeButton

removeButton(button: Any) -> None

X.removeButton(button)

Supplemental documentation: Qt 5 reference:

void QMessageBox::removeButton(QAbstractButton *button)

Removes button from the button box without deleting it.

This function was introduced in Qt 4.2.

See also addButton() and setStandardButtons().

Upstream PySide2 reference signatures (binding differences may apply):

removeButton(self, button: PySide2.QtWidgets.QAbstractButton) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#removeButton

resizeEvent

resizeEvent(event: Any) -> None

X.resizeEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMessageBox::resizeEvent(QResizeEvent *event)

Reimplements: QDialog::resizeEvent(QResizeEvent *).

Upstream PySide2 reference signatures (binding differences may apply):

resizeEvent(self, event: PySide2.QtGui.QResizeEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#resizeEvent

setCheckBox

setCheckBox(cb: Any) -> None

X.setCheckBox(cb)

Supplemental documentation: Qt 5 reference:

void QMessageBox::setCheckBox(QCheckBox *cb)

Sets the checkbox cb on the message dialog. The message box takes ownership of the checkbox. The argument cb can be nullptr to remove an existing checkbox from the message box.

This function was introduced in Qt 5.2.

See also checkBox().

Upstream PySide2 reference signatures (binding differences may apply):

setCheckBox(self, cb: PySide2.QtWidgets.QCheckBox) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setCheckBox

setDefaultButton

setDefaultButton(button: Any) -> None

X.setDefaultButton(button)

Supplemental documentation: Qt 5 reference:

void QMessageBox::setDefaultButton(QPushButton *button)

Sets the message box's default button to button.

This function was introduced in Qt 4.2.

See also defaultButton(), addButton(), and QPushButton::setDefault().

void QMessageBox::setDefaultButton(QMessageBox::StandardButton button)

Sets the message box's default button to button.

This function was introduced in Qt 4.3.

See also addButton() and QPushButton::setDefault().

Upstream PySide2 reference signatures (binding differences may apply):

setDefaultButton(self, button: PySide2.QtWidgets.QMessageBox.StandardButton) -> None
setDefaultButton(self, button: PySide2.QtWidgets.QPushButton) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setDefaultButton

setDetailedText

setDetailedText(text: str) -> None

X.setDetailedText(text)

Upstream PySide2 reference signatures (binding differences may apply):

setDetailedText(self, text: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setDetailedText

setEscapeButton

setEscapeButton(button: Any) -> None

X.setEscapeButton(button)

Supplemental documentation: Qt 5 reference:

void QMessageBox::setEscapeButton(QAbstractButton *button)

Sets the button that gets activated when the Escape key is pressed to button.

This function was introduced in Qt 4.2.

See also escapeButton(), addButton(), and clickedButton().

void QMessageBox::setEscapeButton(QMessageBox::StandardButton button)

Sets the buttons that gets activated when the Escape key is pressed to button.

This function was introduced in Qt 4.3.

See also addButton() and clickedButton().

Upstream PySide2 reference signatures (binding differences may apply):

setEscapeButton(self, button: PySide2.QtWidgets.QAbstractButton) -> None
setEscapeButton(self, button: PySide2.QtWidgets.QMessageBox.StandardButton) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setEscapeButton

setIcon

setIcon(arg__1: Any) -> None

X.setIcon(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setIcon(self, arg__1: PySide2.QtWidgets.QMessageBox.Icon) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setIcon

setIconPixmap

setIconPixmap(pixmap: Any) -> None

X.setIconPixmap(pixmap)

Upstream PySide2 reference signatures (binding differences may apply):

setIconPixmap(self, pixmap: PySide2.QtGui.QPixmap) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setIconPixmap

setInformativeText

setInformativeText(text: str) -> None

X.setInformativeText(text)

Upstream PySide2 reference signatures (binding differences may apply):

setInformativeText(self, text: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setInformativeText

setStandardButtons

setStandardButtons(buttons: Any) -> None

X.setStandardButtons(buttons)

Upstream PySide2 reference signatures (binding differences may apply):

setStandardButtons(self, buttons: PySide2.QtWidgets.QMessageBox.StandardButtons) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setStandardButtons

setText

setText(text: str) -> None

X.setText(text)

Upstream PySide2 reference signatures (binding differences may apply):

setText(self, text: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setText

setTextFormat

setTextFormat(format: Any) -> None

X.setTextFormat(format)

Upstream PySide2 reference signatures (binding differences may apply):

setTextFormat(self, format: PySide2.QtCore.Qt.TextFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setTextFormat

setTextInteractionFlags

setTextInteractionFlags(arg0: flags) -> None

X.setTextInteractionFlags(flags)

Upstream PySide2 reference signatures (binding differences may apply):

setTextInteractionFlags(self, flags: PySide2.QtCore.Qt.TextInteractionFlags) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setTextInteractionFlags

setWindowModality

setWindowModality(windowModality: Any) -> None

X.setWindowModality(windowModality)

Supplemental documentation: Qt 5 reference:

void QMessageBox::setWindowModality(Qt::WindowModality windowModality)

This function shadows QWidget::setWindowModality().

Sets the modality of the message box to windowModality.

On macOS, if the modality is set to Qt::WindowModal and the message box has a parent, then the message box will be a Qt::Sheet, otherwise the message box will be a standard dialog.

This function was introduced in Qt 4.2.

Upstream PySide2 reference signatures (binding differences may apply):

setWindowModality(self, windowModality: PySide2.QtCore.Qt.WindowModality) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setWindowModality

setWindowTitle

setWindowTitle(a: Any) -> None

X.setWindowTitle(a)

Supplemental documentation: Qt 5 reference:

void QMessageBox::setWindowTitle(const QString \&title)

This function shadows QWidget::setWindowTitle().

Sets the title of the message box to title. On macOS, the window title is ignored (as required by the macOS Guidelines).

This function was introduced in Qt 4.2.

Upstream PySide2 reference signatures (binding differences may apply):

setWindowTitle(self, title: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#setWindowTitle

showEvent

showEvent(event: Any) -> None

X.showEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QMessageBox::showEvent(QShowEvent *e)

Reimplements: QDialog::showEvent(QShowEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

showEvent(self, event: PySide2.QtGui.QShowEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#showEvent

standardButton

standardButton(button: Any) -> Any

X.standardButton(button)

Supplemental documentation: Qt 5 reference:

QMessageBox::StandardButton QMessageBox::standardButton(QAbstractButton *button) const

Returns the standard button enum value corresponding to the given button, or NoButton if the given button isn't a standard button.

This function was introduced in Qt 4.2.

See also button() and standardButtons().

Upstream PySide2 reference signatures (binding differences may apply):

standardButton(self, button: PySide2.QtWidgets.QAbstractButton) -> PySide2.QtWidgets.QMessageBox.StandardButton

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#standardButton

standardButtons instance-attribute

standardButtons: Any

Qt 5 reference:

standardButtons : StandardButtons

collection of standard buttons in the message box

This property controls which standard buttons are used by the message box.

By default, this property contains no standard buttons.

This property was introduced in Qt 4.2.

Access functions:

QMessageBox::StandardButtons standardButtons() const
void setStandardButtons(QMessageBox::StandardButtons buttons)

See also addButton().

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#standardButtons

text instance-attribute

text: str

Qt 5 reference:

text : QString

This property holds the message box text to be displayed.

The text will be interpreted either as a plain text or as rich text, depending on the text format setting (QMessageBox::textFormat). The default setting is Qt::AutoText, i.e., the message box will try to auto-detect the format of the text.

The default value of this property is an empty string.

Access functions:

QString text() const
void setText(const QString \&text)

See also textFormat, QMessageBox::informativeText, and QMessageBox::detailedText.

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#text

textFormat instance-attribute

textFormat: Any

Qt 5 reference:

textFormat : Qt::TextFormat

This property holds the format of the text displayed by the message box

The current text format used by the message box. See the Qt::TextFormat enum for an explanation of the possible options.

The default format is Qt::AutoText.

Access functions:

Qt::TextFormat textFormat() const
void setTextFormat(Qt::TextFormat format)

See also setText().

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#textFormat

textInteractionFlags instance-attribute

textInteractionFlags: Any

Qt 5 reference:

textInteractionFlags : Qt::TextInteractionFlags

Specifies how the label of the message box should interact with user input.

The default value depends on the style.

This property was introduced in Qt 5.1.

Access functions:

Qt::TextInteractionFlags textInteractionFlags() const
void setTextInteractionFlags(Qt::TextInteractionFlags flags)

See also QStyle::SH_MessageBox_TextInteractionFlags.

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#textInteractionFlags

warning

warning(parent: Any, title: str, text: str, buttons: Any, defaultButton: Any) -> Any

X.warning(parent, title, text, buttons, defaultButton)

Supplemental documentation: Qt 5 reference:

[static] QMessageBox::StandardButton QMessageBox::warning(QWidget *parent, const QString \&title, const QString \&text, QMessageBox::StandardButtons buttons \= Ok, QMessageBox::StandardButton defaultButton \= NoButton)

Opens a warning message box with the given title and text in front of the specified parent widget.

The standard buttons are added to the message box. defaultButton specifies the button used when Enter is pressed. defaultButton must refer to a button that was given in buttons. If defaultButton is QMessageBox::NoButton, QMessageBox chooses a suitable default automatically.

Returns the identity of the standard button that was clicked. If Esc was pressed instead, the escape button is returned.

The message box is an application modal dialog box.

Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QMessageBox constructors.

This function was introduced in Qt 4.2.

See also question(), information(), and critical().

Upstream PySide2 reference signatures (binding differences may apply):

warning(parent: PySide2.QtWidgets.QWidget, title: str, text: str, button0: PySide2.QtWidgets.QMessageBox.StandardButton, button1: PySide2.QtWidgets.QMessageBox.StandardButton) -> int
warning(parent: PySide2.QtWidgets.QWidget, title: str, text: str, buttons: PySide2.QtWidgets.QMessageBox.StandardButtons=..., defaultButton: PySide2.QtWidgets.QMessageBox.StandardButton=...) -> PySide2.QtWidgets.QMessageBox.StandardButton

Source: https://doc.qt.io/archives/qt-5.15/qmessagebox.html#warning

windowIconChanged

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

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

windowIconTextChanged

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

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

windowTitleChanged

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

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