-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViolationItem.py
36 lines (26 loc) · 967 Bytes
/
ViolationItem.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
from time import localtime, asctime
from PyQt5 import QtWidgets
from PyQt5.uic import loadUi
from Database import KEYS
from DetailLogWindow import DetailLogWindow
class ViolationItem (QtWidgets.QListWidget):
def __init__ (self, parent = None):
super(ViolationItem, self).__init__(parent)
loadUi("./UI/ViolationItem.ui", self)
self.details_button.clicked.connect(self.showDetails)
self.data = {}
def setData(self, data):
self.data = data
self.setCarId(data[KEYS.CARID])
self.setTime(asctime(localtime(data[KEYS.TIME])))
self.setCarImage(data[KEYS.CARIMAGE])
def showDetails(self):
window = DetailLogWindow(self.data, self)
window.show()
def setCarId(self, id):
self.carid.setText(str(id))
def setTime(self, time):
self.time.setText(time)
def setCarImage(self, pixmap):
self.carimage.setPixmap(pixmap)
self.carimage.show()