[Turn] common methods and standards button pop-up dialog box, type PyQt

The pop-up dialog pyQt (a QMessageBox) methods and standards commonly used type of button

I. Control Description

QMessageBox is a universal pop-up dialog box that displays the message, allowing the user feedback messages by clicking the different criteria button, and each button has a standard predefined text, characters and hexadecimal numbers .
QNessageBox class provides such as: tips, warnings, errors, queries, etc. About dialog (icon of these different types of dialog boxes only display of different other features are the same)

Two, QMessageBox class common method

infomation(QWidget parent,title text,buttons,defaultButton):

Pop-up message box, the corresponding parameters are as follows:

parent: Specifies the parent window
title: Dialog title
text: Text dialog
buttons: more standard buttons, the default is the OK button
defaultButton: standard button is selected by default, the default is the first button in the dialog box

question(QWidget parent,title text,buttons,defaultButton):

Q & A pop-up dialog box (parameters as above)

warning(QWidget parent,title text,buttons,defaultButton)::

Warning dialog box (parameters as above)

critical(QWidget parent,title text,buttons,defaultButton):

Serious error dialog box pops up (parameters as above)

about(QWidget parent,title,text)

About pop-up dialog box (parameters as above)

setTitle():

Set Title

setText():

Setting text message

setIcon():

Picture Settings dialog box

Examples refer to the specific code below.

Three, QMessageBox standard button type

QMessage.OK
confirm the operation
QMessage.Cancel
cancel
QMessage.Yes
confirm the operation
QMessage.No
cancel
QMessage.Abort
terminate the operation
QMessage.Retry
retry the operation
QMessage.Igonre
ignore operation

Guess you like

Origin www.cnblogs.com/hester/p/11230534.html