MyMessageBox.py 431 B

12345678910111213
  1. from PySide6.QtWidgets import QMessageBox
  2. def show_dialog(state: QMessageBox.Icon, title: str, massage: str):
  3. msgBox = QMessageBox()
  4. msgBox.setIcon(state)
  5. msgBox.setText(massage)
  6. msgBox.setWindowTitle(title)
  7. msgBox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
  8. # msgBox.buttonClicked.connect(msgButtonClick)
  9. returnValue = msgBox.exec()
  10. if returnValue == QMessageBox.Ok:
  11. print('OK clicked')