Fetch the repository succeeded.
This action will force synchronization from haodafa/face_signin, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
#include "dialog.h"
#include "ui_dialog.h"
#include <QDebug>
#include <QFileDialog>
#include <QWidget>
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::on_btn_choice_clicked()
{
QString s = QFileDialog::getOpenFileName(
this, "选择人脸图片",
"/",
"图片文件 (*.jpg);; 所有文件 (*.*);; ");
//qDebug() << "path=" << s;
if (!s.isEmpty())
{
ui->pic_edit->setText(s);
}
}
void Dialog::on_btn_ok_clicked()
{
if(ui->pic_edit->text() != "")
pic_path = ui->pic_edit->text();
if(ui->name_cn_edit->text() != "")
name_cn = ui->name_cn_edit->text();
if(ui->name_eng_edit->text() != "")
name_eng = ui->name_eng_edit->text();
if(ui->class_edit->text() != "")
class_name = ui->class_edit->text();
if(ui->id_num_edit->text() != "")
id_num = ui->id_num_edit->text();
QString exe_path = QCoreApplication::applicationDirPath();
QString fileName = exe_path + "/data/face_info1.txt";//选择路径
if (fileName.isEmpty()) //如果未选择文件便确认,即返回
return;
QString write_txt = name_cn+" "+name_eng+" "+id_num+ " ";
QFile file(fileName);
pic_path = pic_path.split("/")[pic_path.split("/").size()-1];
if (file.open(QIODevice::ReadWrite | QIODevice::Text))
{
QTextStream stream(&file);
stream.seek(file.size());
stream <<"\n"<< write_txt+"/"+pic_path << " ";
file.close();
}
}
void Dialog::on_btn_cancel_clicked()
{
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。