컴퓨터/Python

python messagebox pyside6 pyqt5

풍경소리^^ 2023. 11. 27. 14:30
# 가상환경 .\venv\Scripts\activate
import sys
from PySide6.QtWidgets import QApplication, QMessageBox

class MessageBox(QMessageBox):
    def __init__(self, parent=None):
        super(MessageBox, self).__init__()

        self.setWindowTitle('파일 생성')
        # self.setFixedSize(200, 100)

        self.setText("파일 생성 완료!")

        # Add an "Ok" button to close the dialog
        ok_button = self.addButton(QMessageBox.Ok)
        ok_button.setText('완료')

if __name__ == '__main__':
    app = QApplication(sys.argv)
    msgBox = MessageBox()
    msgBox.show()
    sys.exit(app.exec())