-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.py
65 lines (53 loc) · 1.6 KB
/
view.py
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
61
62
63
64
65
from PyQt5.QtWidgets import (
QHBoxLayout,
QPushButton,
QVBoxLayout,
QWidget
)
from widgets import DataArea, DataFilter
class View(QWidget):
def __init__(self):
super(View, self).__init__()
self.resize(750, 400)
self.setWindowTitle("账本")
self.mainlayout = QVBoxLayout()
self.setLayout(self.mainlayout)
self.init()
self.update()
def init(self):
# filters
self.filter = DataFilter(self)
datalayout = QHBoxLayout()
# payment
self.payData = DataArea(is_income=False, parent=self)
datalayout.addWidget(self.payData)
# income
self.inData = DataArea(is_income=True, parent=self)
datalayout.addWidget(self.inData)
self.mainlayout.addWidget(self.filter)
self.mainlayout.addLayout(datalayout)
self.setStyleSheet('''
QLabel{
font-weight:1000;
font-family:"STKaiti";
}
QPushButton{
color:white;
background:blue;
padding:3px;
border-radius:5px;
font-weight:1000;
font-family:"STKaiti";
}
QLineEdit{
padding:3px;
border: 1px solid black;
border-radius:5px;
font-weight:1000;
font-family:"STKaiti";
}
''')
def update(self):
inDataList, payDataList = self.filter.get_data()
self.inData.update(inDataList)
self.payData.update(payDataList)