-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConfirmDialog.py
More file actions
56 lines (47 loc) · 1.53 KB
/
ConfirmDialog.py
File metadata and controls
56 lines (47 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
class ConfirmDialog(QDialog):
def __init__(self, text):
super().__init__()
self.text = text
self.initUI()
def initUI(self):
self.resize(400, 250)
self.setStyleSheet("background-color:#E5E9F5;")
self.center()
layout = QVBoxLayout()
layout.addStretch(1)
label = QLabel(self.text)
label.setAlignment(Qt.AlignCenter)
font = label.font()
font.setPointSize(30)
label.setFont(font)
self.label = label
btnOK = QPushButton("확인")
btnOK.resize(100, 50)
btnOK.clicked.connect(self.onOKButtonClicked)
btnOK.setStyleSheet("""
QPushButton {
margin: 35px 0px 50px 0px;
background-color: #85B6FF;
border: 1px solid;
border-radius: 5px;
font: bold;
font-size: 20px;
}
QPushButton:hover {
background-color: #FEBB61;
}
""")
layout.addWidget(label)
layout.addWidget(btnOK)
self.setLayout(layout)
def onOKButtonClicked(self):
self.accept()
def showModal(self):
return super().exec_()
def center(self):
qr = self.frameGeometry()
cp = QDesktopWidget().availableGeometry().center()
qr.moveCenter(cp)
self.move(qr.topLeft())