“MessageBox Python Pyqt” Code-Antworten

PYQT5 -Nachrichtenbox

# in pyqt5 it needs to be PyQt5.QtWidgets
msg=QMessageBox() # create an instance of it
msg.setIcon(QMessageBox.Information) # set icon
msg.setText("This is a message box") # set text
msg.setInformativeText("This is additional information") # set information under the main text
msg.setWindowTitle("MessageBox demo") # set title
msg.setDetailedText("The details are as follows:") # a button for more details will add in
msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel) # type of buttons associated
msg.buttonClicked.connect(myfunc) # connect clicked signal
return_value =msg.exec_() # get the return value
print("value of pressed message box button:", str(return_value)) # print result
Jenova

MessageBox Python Pyqt

QMessageBox.about(self, "Title", "Message")
Smoggy Shark

Ähnliche Antworten wie “MessageBox Python Pyqt”

Fragen ähnlich wie “MessageBox Python Pyqt”

Weitere verwandte Antworten zu “MessageBox Python Pyqt” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen