Notice
Recent Posts
Recent Comments
Link
아미(아름다운미소)
Python PyQt5 messagebox 본문
PyQt5 messagebox
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QMessageBox
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot
class App(QWidget):
def __init__(self):
super().__init__()
self.title = 'PyQt5 messagebox'
self.left = 10
self.top = 10
self.width = 320
self.height = 200
self.initUI()
def initUI(self):
self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height)
buttonReply = QMessageBox.question(self, 'PyQt5 message', "선택한 항목을 삭제하시겠습니까?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
if buttonReply == QMessageBox.Yes:
print('Yes clicked.')
else:
print('No clicked.')
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = App()
sys.exit(app.exec_())
'랭귀지 > python' 카테고리의 다른 글
| Python pyqt tableWidget double click event (2) | 2018.12.19 |
|---|---|
| python PyQt에서 QCalendarWidget을 사용하여 날짜선택하기 (0) | 2018.12.18 |
| Python PyQt5 QtSql 사용예 (0) | 2018.12.14 |
| Python PyQt5 click action on Qwidget (0) | 2018.12.13 |
| Python PyQt5 QInputDialog 다이얼로그 팝업창 띄우기 (0) | 2018.12.12 |
Comments