qfedu-qt-level/homework-day1/widget8.cpp

27 lines
535 B
C++
Raw Permalink Normal View History

2023-08-08 17:47:59 +08:00
#include "widget8.h"
Widget8::Widget8(QWidget *parent) : QWidget(parent)
{
judgeCount = 0;
}
void Widget8::receviceStudentSelection(const QString &stuName)
{
selectedStudents.insert(stuName);
judgeCount++;
if(judgeCount == 3)
{
// 所有评委选择完毕
qDebug()<<"学生名单: ";
for(const QString &stu: selectedStudents)
{
qDebug()<<stu;
}
// 清空数据,准备下一轮评选
selectedStudents.clear();
judgeCount = 0;
}
}