-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction2.py
More file actions
60 lines (46 loc) · 1.68 KB
/
action2.py
File metadata and controls
60 lines (46 loc) · 1.68 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
57
58
59
60
# action2.py
import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import QDateTime
import databaseConnection
import makeInform
class Action2(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
lbl1 = QLabel('1. 날짜 & 시간')
self.datetimeedit = QDateTimeEdit(self)
self.datetimeedit.setDateTime(QDateTime.currentDateTime())
self.datetimeedit.setDateTimeRange(QDateTime(1900, 1, 1, 00, 00, 00), QDateTime(2100, 1, 1, 00, 00, 00))
self.datetimeedit.setDisplayFormat('yyyy.MM.dd hh:mm:ss')
lbl2 = QLabel('2. 행동', self)
# self.lbl1.move(60, 40)
self.te = QTextEdit()
self.te.setAcceptRichText(False)
# self.te.move(60, 70)
btn = QPushButton(self)
btn.setText('확인')
btn.clicked.connect(self.save_action)
vbox = QVBoxLayout()
vbox.addWidget(lbl1)
vbox.addWidget(self.datetimeedit)
vbox.addWidget(lbl2)
vbox.addWidget(self.te)
vbox.addWidget(btn)
vbox.addStretch()
self.setLayout(vbox)
self.setWindowTitle('Action 입력')
self.setGeometry(300, 300, 300, 200)
self.show()
def save_action(self):
widgetLst = [self.datetimeedit, self.te]
make_inform = makeInform.MakeInform()
query = make_inform.makeQuery(widgetLst,3)
dbConnection = databaseConnection.DatabaseConnection()
dbConnection.dbSave(query,3)
# print("save query 완료")
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Action2()
sys.exit(app.exec_())