代码拉取完成,页面将自动刷新
同步操作将从 haodafa/face_signin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "administor.h"
#include "ui_administor.h"
#include <QMessageBox>
#include <QFileDialog>
administor::administor(QWidget *parent) :
QWidget(parent),
ui(new Ui::administor)
{
ui->setupUi(this);
QTime time(7,50);
ui->timeEdit_start->setTime(time);
QTime time1(8,10);
ui->timeEdit_end->setTime(time1);
end_time = ui->timeEdit_end->text();
ui->timeEdit_start->setEnabled(false);
ui->timeEdit_end->setEnabled(false);
ui->add_stu->setEnabled(false);
ui->time_ok->setEnabled(false);
// add_person = new Person();
}
administor::~administor()
{
delete ui;
}
void administor::on_admin_login_clicked()
{
QString user_id = this->ui->admin_id->text();
QString user_passwd = this->ui->admin_passwd->text();
if("1" == user_id && "1" == user_passwd)
{
ui->timeEdit_start->setEnabled(true);
ui->timeEdit_end->setEnabled(true);
ui->add_stu->setEnabled(true);
ui->time_ok->setEnabled(true);
}
else
{
QMessageBox::information(NULL, "提示", "账号和密码都是1!");
}
}
void administor::on_add_stu_clicked()
{
//在信息有效且不为空的情况下发送添加的学生数据
Person person;
if(ui->name_cn_edit->text() !=""
&& ui->name_eng_edit->text() != ""
&& ui->id_edit->text() !=""
&& ui->class_edit_2->text() != "")
{
person.set_cn_name(ui->name_cn_edit->text());
person.set_eng_name(ui->name_eng_edit->text());
person.id_num = ui->id_edit->text();
person.class_num = ui->class_edit_2->text();
person.pic_path = ui->picpath_edit->text();
person.sign_in = false;
emit send_data(person);
ui->name_cn_edit->setText("");
ui->name_eng_edit->setText("");
ui->id_edit->setText("");
ui->class_edit_2->setText("");
ui->picpath_edit->setText("");
ui->admin_id->setText("");
ui->admin_passwd->setText("");
ui->timeEdit_start->setEnabled(false);
ui->timeEdit_end->setEnabled(false);
ui->add_stu->setEnabled(false);
ui->time_ok->setEnabled(false);
this->close();
}
else
{
QMessageBox::information(NULL, "提示", "请完善学生信息!");
}
}
void administor::on_btn_choice_clicked()
{
QString exe_path = QCoreApplication::applicationDirPath();
QString s = QFileDialog::getOpenFileName(
this, "选择人脸图片",
exe_path + "/data/face_lib",
"图片文件 (*.jpg);; 所有文件 (*.*);; ");
//qDebug() << "path=" << s;
if (!s.isEmpty())
{
ui->picpath_edit->setText(s);
}
}
void administor::closeEvent(QCloseEvent *event)
{
int flag = 1;
emit send_time_start(flag);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。