adminSelectCourse.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:DCheat 作者: DCheat 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号