

#include "widget.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Widget w;
w.show();
VideoCapture mv;
mv.open("D:\\opencv\\heads\\01.mp4");
//定义一个存放视频里读取到的一帧图像
Mat src;
//定义一个存放灰度视频的
Mat gray;
//定义一个存放均衡化的容器
Mat dst;
while(mv.read(src)){
//显示图像
imshow("test1",src);
//灰度处理
cvtColor(src,gray,CV_BGR2GRAY);
namedWindow("test2");
imshow("test2",gray);
equalizeHist(gray,dst);
namedWindow("test3");
imshow("test3",dst);
if(waitKey(40)==27){
break;
}
}


void Widget::on_deleteBtn_clicked()
{
QSqlQuery query;
int numb=ui->numberEdit->text().toUInt();
QString name=ui->nameEdit->text();
if(numb==0&&name.isEmpty()){
QMessageBox::information(this,"提示","请填写完整信息");
return;
}else if(numb!=0){
QString sql=QString("delete from stu_info_table where numb=%1 ").arg(numb);
if(query.exec(sql)){
QMessageBox::information(this,"提示","删除成功!");
}else{
QMessageBox::information(this,"错误","删除失败!");
}
}else if(!name.isEmpty()){
QString sql=QString("delete from stu_info_table where name='%1' ").arg(name);
if(query.exec(sql)){
QMessageBox::information(this,"提示","删除成功!");
}else{
QMessageBox::information(this,"错误","删除失败!");
}
}
}

