-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArchive.py
31 lines (24 loc) · 1.06 KB
/
Archive.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
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QMainWindow, QListWidget
from PyQt5.uic import loadUi
from Database import Database
from ViolationItem import ViolationItem
class ArchiveWindow(QMainWindow):
def __init__(self, parent=None):
super(ArchiveWindow, self).__init__(parent)
loadUi('UI/Archive.ui', self)
self.cancel.clicked.connect(self.close)
self.log_tabwidget.clear()
self.violation_list = QListWidget(self)
self.log_tabwidget.addTab(self.violation_list, "Violations")
self.violation_list.clear()
rows = Database.get_instance().get_violations_from_cam(None, cleared=True)
for row in rows:
listWidget = ViolationItem()
listWidget.setData(row)
listWidgetItem = QtWidgets.QListWidgetItem(self.violation_list)
listWidgetItem.setSizeHint(listWidget.sizeHint())
self.violation_list.addItem(listWidgetItem)
self.violation_list.setItemWidget(listWidgetItem, listWidget)
def close(self):
self.destroy(True)