-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnotis.py
152 lines (141 loc) · 6.81 KB
/
notis.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'notification.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
lst=[("Ikram","Khan"),("Usman","Tahir"),("Ali","Naqi")]
class Ui_MainNotificationWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(750, 690)
MainWindow.move(265,10)
MainWindow.setMinimumSize(QtCore.QSize(850, 690))
MainWindow.setMaximumSize(QtCore.QSize(850, 690))
MainWindow.setStyleSheet("")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.widget = QtWidgets.QWidget(self.centralwidget)
self.widget.setGeometry(QtCore.QRect(0, 0, 850, 690))
self.widget.setMinimumSize(QtCore.QSize(850, 690))
self.widget.setMaximumSize(QtCore.QSize(850, 690))
font = QtGui.QFont()
font.setFamily("Tahoma")
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.widget.setFont(font)
self.widget.setStyleSheet("background-color:#be808e;\n"
"background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0.813, y2:0.653409, stop:0#00264d, stop:1#be808e);")
self.widget.setObjectName("widget")
self.infotext = QtWidgets.QLabel(self.widget)
self.infotext.setGeometry(QtCore.QRect(341, 201, 201, 51))
font = QtGui.QFont()
font.setFamily("Tahoma")
font.setPointSize(12)
font.setBold(False)
font.setItalic(False)
font.setUnderline(False)
font.setWeight(50)
self.infotext.setFont(font)
self.infotext.setStyleSheet("font: 12pt \"Tahoma\";\n"
"border-radius:10px;\n"
"color:#093545;\n"
"background-color:white;\n"
"text-align: center;")
self.infotext.setObjectName("infotext")
self.uetlogo = QtWidgets.QLabel(self.widget)
self.uetlogo.setGeometry(QtCore.QRect(50, 60, 120, 110))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(63)
sizePolicy.setHeightForWidth(self.uetlogo.sizePolicy().hasHeightForWidth())
self.uetlogo.setSizePolicy(sizePolicy)
self.uetlogo.setMinimumSize(QtCore.QSize(0, 0))
self.uetlogo.setStyleSheet("background-color:none;")
self.uetlogo.setText("")
self.uetlogo.setPixmap(QtGui.QPixmap("src/uetlogo.png"))
self.uetlogo.setScaledContents(True)
self.uetlogo.setObjectName("uetlogo")
self.notificatiotable = QtWidgets.QTableWidget(self.widget)
self.notificatiotable.setGeometry(QtCore.QRect(176, 303, 531, 25+len(lst)*30))
self.notificatiotable.setStyleSheet("background-color:#c5bacc;\n"
" border-radius: 10px ;\n"
"self.tablewidget.setColumWidth:(0,233);")
self.notificatiotable.setShowGrid(True)
self.notificatiotable.setGridStyle(QtCore.Qt.SolidLine)
self.notificatiotable.setRowCount(len(lst))
self.notificatiotable.setColumnCount(2)
self.notificatiotable.setObjectName("notificatiotable")
item = QtWidgets.QTableWidgetItem()
font = QtGui.QFont()
font.setFamily("Tahoma")
font.setPointSize(10)
font.setBold(False)
font.setWeight(50)
item.setFont(font)
self.notificatiotable.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
font = QtGui.QFont()
font.setPointSize(10)
font.setBold(False)
font.setWeight(50)
item.setFont(font)
self.notificatiotable.setHorizontalHeaderItem(1, item)
self.notificatiotable.horizontalHeader().setVisible(True)
self.notificatiotable.horizontalHeader().setDefaultSectionSize(258)
self.notificatiotable.verticalHeader().setCascadingSectionResizes(False)
self.notificatiotable.verticalHeader().setDefaultSectionSize(30)
self.notificatiotable.verticalHeader().setSortIndicatorShown(False)
self.notificatiotable.verticalHeader().setStretchLastSection(True)
# self.notificatiotable.setItem(0,0,QtWidgets.QTableWidgetItem("Ikram Khan"))
self.back_button = QtWidgets.QPushButton(self.widget)
self.back_button.setGeometry(QtCore.QRect(631, 587, 75, 23))
self.back_button.setMouseTracking(True)
self.back_button.setStyleSheet("background-color:#093545;\n"
"border-radius:10px;\n"
"color:white;\n"
"font: 75 10pt \"Tahoma\";\n"
"letter-spacing: 2 px;")
self.back_button.setObjectName("back_button")
self.cslogo = QtWidgets.QLabel(self.widget)
self.cslogo.setGeometry(QtCore.QRect(700, 60, 120, 110))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(63)
sizePolicy.setHeightForWidth(self.cslogo.sizePolicy().hasHeightForWidth())
self.cslogo.setSizePolicy(sizePolicy)
self.cslogo.setMinimumSize(QtCore.QSize(0, 0))
self.cslogo.setStyleSheet("background-color:none;")
self.cslogo.setText("")
self.cslogo.setPixmap(QtGui.QPixmap("src/cs.png"))
self.cslogo.setScaledContents(True)
self.cslogo.setObjectName("cslogo")
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.infotext.setText(_translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:18pt;\">NOTIFICATIONS</span></p></body></html>"))
self.notificatiotable.setSortingEnabled(True)
item = self.notificatiotable.horizontalHeaderItem(0)
item.setText(_translate("MainWindow", "Name"))
item = self.notificatiotable.horizontalHeaderItem(1)
item.setText(_translate("MainWindow", "Notified Date"))
self.back_button.setText(_translate("MainWindow", "Back"))
self.table_list()
def table_list(self):
for ls, i in zip(lst, range(0, len(lst))):
self.notificatiotable.setItem(i,0,QtWidgets.QTableWidgetItem(ls[0]))
self.notificatiotable.setItem(i,1,QtWidgets.QTableWidgetItem(ls[1]))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainNotificationWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())