MyMessageBox.py 474 B

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