def makeCourseLayout(self):
try:
if self.pListLayout.count() is not 0:
while self.pListLayout.count():
item = self.pListLayout.takeAt(0)
wid = item.widget()
wid.deleteLater()
except Exception as e:
print(e)
listPos = 0
for course in self.courseList:
if len(course) is 0:
break
courseInfo = course.split(',')
courseLabel = QtWidgets.QLabel(courseInfo[0])
startLabel = QtWidgets.QLabel(courseInfo[1])
endLabel = QtWidgets.QLabel(courseInfo[2])
countLabel = QtWidgets.QLabel(courseInfo[5])
courseLabel.setAlignment(Qt.AlignHCenter)
startLabel.setAlignment(Qt.AlignHCenter)
endLabel.setAlignment(Qt.AlignHCenter)
countLabel.setAlignment(Qt.AlignHCenter)
button = QtWidgets.QPushButton("??")
button.clicked.connect(self.modify_test)
self.pListLayout.addWidget(courseLabel, listPos, 0)
self.pListLayout.addWidget(startLabel, listPos, 1)
self.pListLayout.addWidget(endLabel, listPos, 2)
self.pListLayout.addWidget(countLabel, listPos, 3)
self.pListLayout.addWidget(button, listPos, 4)
listPos += 1
self.ui.show()
评论列表
文章目录