“kotak pesan pyqt5” Kode Jawaban

kotak pesan pyqt5

# 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

PYTHON PYTHON PYQT

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

Jawaban yang mirip dengan “kotak pesan pyqt5”

Pertanyaan yang mirip dengan “kotak pesan pyqt5”

Lebih banyak jawaban terkait untuk “kotak pesan pyqt5” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya