-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstructor.py
More file actions
89 lines (75 loc) · 3.84 KB
/
instructor.py
File metadata and controls
89 lines (75 loc) · 3.84 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
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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Instructor.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# 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.
#############################################################
# #
# UI Generation #
# #
#############################################################
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog, listValues):
Dialog.setObjectName("Dialog")
Dialog.resize(272, 137)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setGeometry(QtCore.QRect(10, 100, 251, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.formLayoutWidget = QtWidgets.QWidget(Dialog)
self.formLayoutWidget.setGeometry(QtCore.QRect(10, 20, 251, 71))
self.formLayoutWidget.setObjectName("formLayoutWidget")
self.formLayout = QtWidgets.QFormLayout(self.formLayoutWidget)
self.formLayout.setLabelAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.formLayout.setContentsMargins(0, 0, 0, 0)
self.formLayout.setObjectName("formLayout")
self.lblInstructorID = QtWidgets.QLabel(self.formLayoutWidget)
self.lblInstructorID.setObjectName("lblInstructorID")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.lblInstructorID)
self.txtInstructorID = QtWidgets.QLineEdit(self.formLayoutWidget)
self.txtInstructorID.setReadOnly(False)
self.txtInstructorID.setObjectName("txtInstructorID")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.txtInstructorID)
self.lblInstructorName = QtWidgets.QLabel(self.formLayoutWidget)
self.lblInstructorName.setObjectName("lblInstructorName")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.lblInstructorName)
self.txtInstructorName = QtWidgets.QLineEdit(self.formLayoutWidget)
self.txtInstructorName.setObjectName("txtInstructorName")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.txtInstructorName)
self.retranslateUi(Dialog)
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
QtCore.QMetaObject.connectSlotsByName(Dialog)
# Update UI Here
self.listValues = listValues
self.initialSetup()
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.lblInstructorID.setText(_translate("Dialog", "Instructor ID:"))
self.lblInstructorName.setText(_translate("Dialog", "Name:"))
##################### End UI Generation ###################
def initialSetup(self):
self.setValues()
def setValues(self):
if self.listValues == None: #No list
return
self.txtInstructorID.setText(self.listValues[0])
self.txtInstructorName.setText(self.listValues[1])
def getValues(self):
listResult = []
listResult.append(self.txtInstructorID.text())
listResult.append(self.txtInstructorName.text())
return listResult
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog, None)
Dialog.show()
sys.exit(app.exec_())