QErrorMessage¶
The
QErrorMessage
class provides an error message display dialog. More…
Synopsis¶
Slots¶
def
showMessage
(message)def
showMessage
(message, type)
Static functions¶
def
qtHandler
()
Detailed Description¶
An error message widget consists of a text label and a checkbox. The checkbox lets the user control whether the same error message will be displayed again in the future, typically displaying the text, “Show this message again” translated into the appropriate local language.
For production applications, the class can be used to display messages which the user only needs to see once. To use
QErrorMessage
like this, you create the dialog in the usual way, and show it by calling theshowMessage()
slot or connecting signals to it.The static
qtHandler()
function installs a message handler usingqInstallMessageHandler()
and creates aQErrorMessage
that displaysqDebug()
,qWarning()
andqFatal()
messages. This is most useful in environments where no console is available to display warnings and error messages.In both cases
QErrorMessage
will queue pending messages and display them in order, with each new message being shown as soon as the user has accepted the previous message. Once the user has specified that a message is not to be shown again it is automatically skipped, and the dialog will show the next appropriate message in the queue.The Standard Dialogs example shows how to use
QErrorMessage
as well as other built-in Qt dialogs.See also
QMessageBox
showMessage()
Standard Dialogs Example
- class PySide2.QtWidgets.QErrorMessage([parent=None])¶
- param parent:
Constructs and installs an error handler window with the given
parent
.
- static PySide2.QtWidgets.QErrorMessage.qtHandler()¶
- Return type:
Returns a pointer to a
QErrorMessage
object that outputs the default Qt messages. This function creates such an object, if there isn’t one already.
- PySide2.QtWidgets.QErrorMessage.showMessage(message)¶
- Parameters:
message – str
Shows the given message,
message
, and returns immediately. If the user has requested for the message not to be shown again, this function does nothing.Normally, the message is displayed immediately. However, if there are pending messages, it will be queued to be displayed later.
- PySide2.QtWidgets.QErrorMessage.showMessage(message, type)
- Parameters:
message – str
type – str
This is an overloaded function.
Shows the given message,
message
, and returns immediately. If the user has requested for messages of type,type
, not to be shown again, this function does nothing.Normally, the message is displayed immediately. However, if there are pending messages, it will be queued to be displayed later.
See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.