diff --git a/baseinfo/resultwindow.cpp b/baseinfo/resultwindow.cpp index 26e448b..e516d73 100644 --- a/baseinfo/resultwindow.cpp +++ b/baseinfo/resultwindow.cpp @@ -9,9 +9,248 @@ ResultWindow::ResultWindow(QWidget *parent) : this->setFixedSize(766,383); this->setWindowModality(Qt::ApplicationModal); this->setWindowFlags(Qt::Dialog); + + Refresh_ResultInfo_Table_INITIAL(ui->tbResult); + Table_To_ComboBox(ui->cboxClass, "class", 2, true); + Table_To_ComboBox(ui->cboxGrade, "grade", 1, true); + Table_To_ComboBox(ui->cboxKinds, "examkinds", 1, true); + Table_To_ComboBox(ui->cboxStuName, "student", 0, true); + Table_To_ComboBox(ui->cboxSubject, "subject", 1, true); + ui->cboxClass->setCurrentIndex(ui->cboxClass->count()-1); + ui->cboxGrade->setCurrentIndex(ui->cboxGrade->count()-1); + ui->cboxKinds->setCurrentIndex(ui->cboxKinds->count()-1); + ui->cboxStuName->setCurrentIndex(ui->cboxStuName->count()-1); + ui->cboxSubject->setCurrentIndex(ui->cboxSubject->count()-1); + + this->subID = Refresh_KindsSubject_Table_Const("subject"); + this->kindID = Refresh_KindsSubject_Table_Const("examkinds"); + + QObject::connect(ui->btnAdd, &QPushButton::clicked, this, &this->add_result); + QObject::connect(ui->btnDel, &QPushButton::clicked, this, &this->del_result); + QObject::connect(ui->btnEdit, &QPushButton::clicked, this, &this->edit_result); + QObject::connect(ui->btnQuery, &QPushButton::clicked, this, &this->refresh_result); + } ResultWindow::~ResultWindow() { delete ui; } + +void ResultWindow::add_result() +{ + if (ui->cboxKinds->currentText()=="所有" || ui->cboxStuName->currentText()=="所有" || ui->cboxSubject->currentText()=="所有") + QMessageBox::warning(this, TITLE, "请选择具体的班级、考试信息!"); + else + { + QString kind = this->kindID[Get_Index_By_Text(ui->cboxKinds, ui->cboxKinds->currentText())]; + QString student = ui->cboxStuName->currentText(); + QString subject = this->subID[Get_Index_By_Text(ui->cboxSubject, ui->cboxSubject->currentText())]; + int ID = ui->tbResult->rowCount()+1; + double result = ui->editResult->value(); + bool status = Add_Result_Table(ui->tbResult, QString("%0").arg(ID), student, kind, subject, QString("%0").arg(result)); + ui->btnQuery->click(); + if (status) + QMessageBox::information(this, TITLE, "添加成绩成功!"); + else + QMessageBox::critical(this, TITLE, "信息增加失败!\n可能是数据库文件损坏、出现重名问题。"); + } +} + +void ResultWindow::del_result() +{ + int row = ui->tbResult->currentRow() + 1; + QMessageBox::StandardButton result = QMessageBox::question(this,TITLE, + "是否要删除成绩 "+ui->tbResult->item(row-1,6)->text()+" ?"); + if (result == QMessageBox::Yes) + { + if (Delete_Table(ui->tbResult, "result", row)) + { + ui->btnQuery->click(); + QMessageBox::information(this,TITLE,"删除成功!"); + } + else + { + ui->btnQuery->click(); + QMessageBox::critical(this,TITLE,"删除失败!"); + } + } + +} + +void ResultWindow::refresh_result() +{ + Refresh_ResultInfo_Table_INITIAL(ui->tbResult); + for (int row=0; rowtbResult->rowCount(); row++) + { + if (ui->cboxClass->currentText() != "所有") + { + if (!ui->tbResult->item(row,2)->text().contains(ui->cboxClass->currentText())) + ui->tbResult->hideRow(row); + } + if (ui->cboxKinds->currentText() != "所有") + { + if (!ui->tbResult->item(row,4)->text().contains(ui->cboxKinds->currentText())) + ui->tbResult->hideRow(row); + } + if (ui->cboxStuName->currentText() != "所有") + { + if (!ui->tbResult->item(row,0)->text().contains(ui->cboxStuName->currentText())) + ui->tbResult->hideRow(row); + } + if (ui->cboxSubject->currentText() != "所有") + { + if (!ui->tbResult->item(row,3)->text().contains(ui->cboxSubject->currentText())) + ui->tbResult->hideRow(row); + } + } +} + +void ResultWindow::edit_result() +{ + QString KeyName, InputTitle, InputLabel; + enum QInputType {STRING, INT, COMBOBOX, UNEDIT, ERROR}; + int NowType = ERROR; + switch (ui->tbResult->currentColumn()) + { + case 0: + KeyName = "stuID"; + InputTitle = "修改学生编号ID"; + InputLabel = "请选择修改后的学生编号ID:"; + NowType = COMBOBOX; + break; + case 1: + KeyName = "stuName"; + InputTitle = "修改学生姓名"; + InputLabel = "请输入修改后的学生姓名:"; + NowType = UNEDIT; + break; + case 2: + KeyName = "classID"; + InputTitle = "修改班级"; + InputLabel = "请选择修改后的班级:"; + NowType = UNEDIT; + break; + case 3: + KeyName = "subID"; + InputTitle = "修改科目"; + InputLabel = "请选择修改后的科目:"; + NowType = COMBOBOX; + break; + case 4: + KeyName = "kindID"; + InputTitle = "修改种类"; + InputLabel = "请输入修改后的考试种类:"; + NowType = COMBOBOX; + break; + case 5: + KeyName = "result"; + InputTitle = "修改成绩"; + InputLabel = "请选择修改后的成绩:"; + NowType = INT; + break; + case 6: + KeyName = "ID"; + InputTitle = "修改编号"; + InputLabel = "请输入要修改后的编号:"; + NowType = STRING; + break; + default: + KeyName = "UNKNOWN BY VLSMB"; + InputTitle = "ERROR404"; + InputLabel = "AN EXPRESSION OCCURRED..."; + } + double Value_INT; + QString Value; + bool status = false; + switch (NowType) + { + case STRING: + Value = QInputDialog::getText(this, InputTitle,InputLabel,QLineEdit::Normal,ui->tbResult->currentItem()->text()); + if (Value!="") + { + status = Updata_Table(ui->tbResult, "result", KeyName, Value); + if (status){ + ui->btnQuery->click(); + QMessageBox::information(this, TITLE, InputTitle+"成功!");} + else{ + ui->btnQuery->click(); + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。");} + } + break; + case INT: // 其实是double,但懒得改了 + Value_INT = QInputDialog::getDouble(this, InputTitle, InputLabel, ui->tbResult->currentItem()->text().toDouble(), 0, 1000, 3); + if (Value_INT != ui->tbResult->currentItem()->text().toDouble()) + { + status = Updata_Table(ui->tbResult, "result", KeyName, QString("%0").arg(Value_INT)); + if (status) + { + ui->btnQuery->click(); + QMessageBox::information(this, TITLE, InputTitle+"成功!"); + } + else + { + ui->btnQuery->click(); + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。"); + } + } + break; + case COMBOBOX: + switch (ui->tbResult->currentColumn()) + { + case 0: + // 修改编号 + Value = QInputDialog::getItem(this, InputTitle, InputLabel,ComboBox_To_StringList(ui->cboxStuName, true), + Get_Index_By_Text(ui->cboxStuName, ui->tbResult->currentItem()->text()),false); + if (Value == ui->tbResult->currentItem()->text()) + break; + status = Updata_Table(ui->tbResult, "result", KeyName, Value); + if (status){ + ui->btnQuery->click(); + QMessageBox::information(this, TITLE, InputTitle+"成功!");} + else + { + ui->btnQuery->click(); + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。"); + } + break; + case 3: + // 修改科目 + Value = QInputDialog::getItem(this, InputTitle, InputLabel,ComboBox_To_StringList(ui->cboxSubject, true), + Get_Index_By_Text(ui->cboxSubject, ui->tbResult->currentItem()->text()),false); + if (Value == ui->tbResult->currentItem()->text()) + break; + status = Updata_Table(ui->tbResult, "result", KeyName, this->subID[Get_Index_By_Text(ui->cboxSubject, Value)]); + if (status){ + ui->btnQuery->click(); + QMessageBox::information(this, TITLE, InputTitle+"成功!");} + else{ + ui->btnQuery->click(); + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。"); + } + break; + case 4: + Value = QInputDialog::getItem(this, InputTitle, InputLabel,ComboBox_To_StringList(ui->cboxKinds, false), + Get_Index_By_Text(ui->cboxKinds, ui->tbResult->currentItem()->text()),false); + if (Value == ui->tbResult->currentItem()->text()) + break; + status = Updata_Table(ui->tbResult, "result", KeyName, this->kindID[Get_Index_By_Text(ui->cboxKinds, Value)]); + if (status){ + ui->btnQuery->click(); + QMessageBox::information(this, TITLE, InputTitle+"成功!");} + else{ + ui->btnQuery->click(); + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。"); + } + break; + } + + break; + case UNEDIT: + QMessageBox::critical(this, TITLE, "禁止修改本项!"); + break; + default: + QMessageBox::critical(this, TITLE, "未知错误!"); + + } +} diff --git a/baseinfo/resultwindow.h b/baseinfo/resultwindow.h index db87dfc..db35146 100644 --- a/baseinfo/resultwindow.h +++ b/baseinfo/resultwindow.h @@ -1,7 +1,12 @@ #ifndef RESULTWINDOW_H #define RESULTWINDOW_H +#include "database.h" +#define TITLE "学生成绩管理系统" #include +#include +#include +#include namespace Ui { class ResultWindow; @@ -14,9 +19,16 @@ class ResultWindow : public QMainWindow public: explicit ResultWindow(QWidget *parent = 0); ~ResultWindow(); + QStringList subID; + QStringList kindID; private: Ui::ResultWindow *ui; +public slots: + void add_result(); + void edit_result(); + void del_result(); + void refresh_result(); }; #endif // RESULTWINDOW_H diff --git a/baseinfo/resultwindow.ui b/baseinfo/resultwindow.ui index 5b983cd..49a4e66 100644 --- a/baseinfo/resultwindow.ui +++ b/baseinfo/resultwindow.ui @@ -151,11 +151,6 @@ QAbstractItemView::NoEditTriggers - - - 编号 - - 学生编号 @@ -186,6 +181,11 @@ 成绩 + + + 编号 + + @@ -202,7 +202,7 @@ - 学生姓名: + 学生编号: @@ -241,17 +241,10 @@ 成绩: - - - - 687 - 356 - 71 - 20 - - - + + false + 233 @@ -260,6 +253,9 @@ 22 + + true + @@ -299,6 +295,25 @@ + + + + 670 + 350 + 71 + 31 + + + + 3 + + + 1000.000000000000000 + + + 0.001000000000000 + + @@ -321,5 +336,85 @@ + + tbResult + doubleClicked(QModelIndex) + btnEdit + click() + + + 380 + 190 + + + 615 + 18 + + + + + cboxClass + currentIndexChanged(int) + btnQuery + click() + + + 424 + 19 + + + 495 + 18 + + + + + cboxKinds + currentIndexChanged(int) + btnQuery + click() + + + 114 + 20 + + + 495 + 18 + + + + + cboxStuName + currentIndexChanged(int) + btnQuery + click() + + + 414 + 363 + + + 495 + 18 + + + + + cboxSubject + currentIndexChanged(int) + btnQuery + click() + + + 584 + 364 + + + 495 + 18 + + + diff --git a/baseinfo/studentwindow.cpp b/baseinfo/studentwindow.cpp index f017f15..7c3a1d7 100644 --- a/baseinfo/studentwindow.cpp +++ b/baseinfo/studentwindow.cpp @@ -9,9 +9,209 @@ StudentWindow::StudentWindow(QWidget *parent) : this->setFixedSize(705,414); this->setWindowModality(Qt::ApplicationModal); this->setWindowFlags(Qt::Dialog); + + Refresh_StudentInfo_Table_INITIAL(ui->tbStudent); + this->gradeID = Refresh_Grade_Table_Const(ui->cboxGrade); + this->classID = Refresh_Classes_Table_Const(ui->cboxClass); + ui->cboxClass->addItem("所有"); + ui->cboxGrade->addItem("所有"); + ui->cboxClass->setCurrentIndex(ui->cboxClass->count()-1); + ui->cboxGrade->setCurrentIndex(ui->cboxGrade->count()-1); + + QObject::connect(ui->btnQuery,&QPushButton::clicked,this, &this->refresh_student); + QObject::connect(ui->btnAdd, &QPushButton::clicked, this, &this->add_student); + QObject::connect(ui->btnDel, &QPushButton::clicked, this, &this->delete_student); + QObject::connect(ui->btnEdit, &QPushButton::clicked, this, &this->updata_student); } StudentWindow::~StudentWindow() { delete ui; } + +void StudentWindow::refresh_student() +{ + Refresh_StudentInfo_Table(ui->tbStudent, ui->cboxGrade, ui->cboxClass); +} +void StudentWindow::add_student() +{ + QString stuID = ui->editID->text(); + QString stuName = ui->editName->text(); + int age = ui->editAge->value(); + QString sex = ui->cboxSex->currentText(); + QString phone = ui->editPhone->text(); + QString address = ui->editAddress->text(); + QString Class = ui->cboxClass->currentText(); + QString grade = ui->cboxGrade->currentText(); + if (stuID=="" || stuName=="" || sex=="" || phone=="" || address=="" || Class=="所有" || grade=="所有") + QMessageBox::warning(this, TITLE, "请输入具体的学生信息以及选择具体的班级和年级!"); + else + { + bool status = Add_Student_Table(ui->tbStudent, ui->cboxClass, ui->cboxGrade, stuID, stuName, + this->classID[Get_Index_By_Text(ui->cboxClass, Class)], + this->gradeID[Get_Index_By_Text(ui->cboxGrade, grade)], QString("%0").arg(age), sex, phone, address); + if (status) + QMessageBox::information(this, TITLE, "学生信息增加成功!"); + else + QMessageBox::critical(this, TITLE, "学生信息增加失败!\n可能是数据库文件损坏、出现重名问题。"); + } +} +void StudentWindow::delete_student() +{ + int row = ui->tbStudent->currentRow() + 1; + QMessageBox::StandardButton result = QMessageBox::question(this,TITLE, + "是否要删除学生 "+ui->tbStudent->item(row-1,0)->text()+" ?"); + if (result == QMessageBox::Yes) + { + if (Delete_Table(ui->tbStudent, "student", row)) + { + ui->btnQuery->click(); + QMessageBox::information(this,TITLE,"删除成功!"); + } + else + { + ui->btnQuery->click(); + QMessageBox::critical(this,TITLE,"删除失败!"); + } + } +} +void StudentWindow::updata_student() +{ + QString KeyName, InputTitle, InputLabel; + enum QInputType {STRING, INT, COMBOBOX, ERROR}; + int NowType = ERROR; + switch (ui->tbStudent->currentColumn()) + { + case 0: + KeyName = "stuID"; + InputTitle = "修改学生编号ID"; + InputLabel = "请输入修改后的学生编号ID:"; + NowType = STRING; + break; + case 1: + KeyName = "stuName"; + InputTitle = "修改学生姓名"; + InputLabel = "请输入修改后的学生姓名:"; + NowType = STRING; + break; + case 2: + KeyName = "classID"; + InputTitle = "修改班级"; + InputLabel = "请选择修改后的班级:"; + NowType = COMBOBOX; + break; + case 3: + KeyName = "gradeID"; + InputTitle = "修改年级"; + InputLabel = "请选择修改后的年级:"; + NowType = COMBOBOX; + break; + case 4: + KeyName = "age"; + InputTitle = "修改年龄"; + InputLabel = "请输入修改后的年龄:"; + NowType = INT; + break; + case 5: + KeyName = "sex"; + InputTitle = "修改性别"; + InputLabel = "请选择修改后的性别:"; + NowType = COMBOBOX; + break; + case 6: + KeyName = "phone"; + InputTitle = "修改电话"; + InputLabel = "请输入要修改后的电话号码:"; + NowType = STRING; + break; + case 7: + KeyName = "address"; + InputTitle = "修改地址"; + InputLabel = "请输入修改后的地址:"; + NowType = STRING; + break; + default: + KeyName = "UNKNOWN BY VLSMB"; + InputTitle = "ERROR404"; + InputLabel = "AN EXPRESSION OCCURRED..."; + } + int Value_INT; + QString Value; + bool status = false; + switch (NowType) + { + case STRING: + Value = QInputDialog::getText(this, InputTitle,InputLabel,QLineEdit::Normal,ui->tbStudent->currentItem()->text()); + if (Value!="") + { + status = Updata_Table(ui->tbStudent, "student", KeyName, Value); + if (status){ + Refresh_StudentInfo_Table(ui->tbStudent, ui->cboxGrade, ui->cboxClass); + QMessageBox::information(this, TITLE, InputTitle+"成功!");} + else + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。"); + } + break; + case INT: + Value_INT = QInputDialog::getInt(this, InputTitle, InputLabel, + ui->tbStudent->currentItem()->text().toInt(),0, 250); + if (Value_INT != ui->tbStudent->currentItem()->text().toInt()) + { + status = Updata_Table(ui->tbStudent, "student", KeyName, QString("%0").arg(Value_INT)); + if (status){ + Refresh_StudentInfo_Table(ui->tbStudent, ui->cboxGrade, ui->cboxClass); + QMessageBox::information(this, TITLE, InputTitle+"成功!");} + else + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。"); + } + break; + case COMBOBOX: + switch (ui->tbStudent->currentColumn()) + { + case 2: + // 修改班级 + Value = QInputDialog::getItem(this, InputTitle, InputLabel,ComboBox_To_StringList(ui->cboxClass, true), + Get_Index_By_Text(ui->cboxClass, ui->tbStudent->currentItem()->text()),false); + if (Value == ui->tbStudent->currentItem()->text()) + break; + status = Updata_Table(ui->tbStudent, "student", KeyName, this->classID[Get_Index_By_Text(ui->cboxClass, Value)]); + if (status){ + Refresh_StudentInfo_Table(ui->tbStudent, ui->cboxGrade, ui->cboxClass); + QMessageBox::information(this, TITLE, InputTitle+"成功!");} + else + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。"); + break; + case 3: + // 修改年级 + Value = QInputDialog::getItem(this, InputTitle, InputLabel,ComboBox_To_StringList(ui->cboxGrade, true), + Get_Index_By_Text(ui->cboxGrade, ui->tbStudent->currentItem()->text()),false); + if (Value == ui->tbStudent->currentItem()->text()) + break; + status = Updata_Table(ui->tbStudent, "student", KeyName, this->gradeID[Get_Index_By_Text(ui->cboxGrade, Value)]); + if (status){ + Refresh_StudentInfo_Table(ui->tbStudent, ui->cboxGrade, ui->cboxClass); + QMessageBox::information(this, TITLE, InputTitle+"成功!");} + else + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。"); + break; + case 5: + // 修改年龄 + Value = QInputDialog::getItem(this, InputTitle, InputLabel,ComboBox_To_StringList(ui->cboxSex, false), + Get_Index_By_Text(ui->cboxSex, ui->tbStudent->currentItem()->text()),false); + if (Value == ui->tbStudent->currentItem()->text()) + break; + status = Updata_Table(ui->tbStudent, "student", KeyName, Value); + if (status){ + Refresh_StudentInfo_Table(ui->tbStudent, ui->cboxGrade, ui->cboxClass); + QMessageBox::information(this, TITLE, InputTitle+"成功!");} + else + QMessageBox::critical(this, TITLE, InputTitle+"失败!\n可能是数据库文件损坏、出现重名问题。"); + break; + } + + break; + default: + QMessageBox::critical(this, TITLE, "未知错误!"); + + } +} diff --git a/baseinfo/studentwindow.h b/baseinfo/studentwindow.h index badbd5a..0be0dff 100644 --- a/baseinfo/studentwindow.h +++ b/baseinfo/studentwindow.h @@ -1,7 +1,12 @@ #ifndef STUDENTWINDOW_H #define STUDENTWINDOW_H +#include "database.h" +#define TITLE "学生成绩管理系统" #include +#include +#include +#include namespace Ui { class StudentWindow; @@ -14,9 +19,17 @@ class StudentWindow : public QMainWindow public: explicit StudentWindow(QWidget *parent = 0); ~StudentWindow(); + QStringList gradeID; + QStringList classID; private: Ui::StudentWindow *ui; + +public slots: + void refresh_student(); + void delete_student(); + void add_student(); + void updata_student(); }; #endif // STUDENTWINDOW_H diff --git a/baseinfo/studentwindow.ui b/baseinfo/studentwindow.ui index 25038a7..e32adc5 100644 --- a/baseinfo/studentwindow.ui +++ b/baseinfo/studentwindow.ui @@ -183,12 +183,12 @@ - 家庭地址 + 联系电话 - 联系电话 + 家庭地址 @@ -266,16 +266,6 @@ 年龄: - - - - 507 - 353 - 71 - 20 - - - @@ -396,6 +386,22 @@ true + + + + 500 + 350 + 71 + 21 + + + + 250 + + + 0 + + @@ -418,5 +424,53 @@ + + cboxClass + currentIndexChanged(int) + btnQuery + click() + + + 363 + 19 + + + 434 + 18 + + + + + cboxGrade + currentIndexChanged(int) + btnQuery + click() + + + 203 + 19 + + + 434 + 18 + + + + + tbStudent + doubleClicked(QModelIndex) + btnEdit + click() + + + 350 + 190 + + + 554 + 18 + + + diff --git a/search/resultinfowindow.cpp b/search/resultinfowindow.cpp index 7640b9c..91089b0 100644 --- a/search/resultinfowindow.cpp +++ b/search/resultinfowindow.cpp @@ -9,9 +9,37 @@ ResultInfoWindow::ResultInfoWindow(QWidget *parent) : this->setFixedSize(762,343); this->setWindowModality(Qt::ApplicationModal); this->setWindowFlags(Qt::Dialog); + + Refresh_ResultInfo_Table_INITIAL(ui->tbResult); + Table_To_ComboBox(ui->cboxKinds, "examkinds", 1, true); + Table_To_ComboBox(ui->cboxSubject, "subject", 1, true); + ui->cboxKinds->setCurrentIndex(ui->cboxKinds->count()-1); + ui->cboxSubject->setCurrentIndex(ui->cboxSubject->count()-1); + + QObject::connect(ui->btnQuery, &QPushButton::clicked, this, &this->search_result); } ResultInfoWindow::~ResultInfoWindow() { delete ui; } + +void ResultInfoWindow::search_result() +{ + Refresh_ResultInfo_Table_INITIAL(ui->tbResult); + for (int row=0; row< ui->tbResult->rowCount(); row++) + { + if (ui->cboxKinds->currentText() != "所有") + { + if (!ui->tbResult->item(row,4)->text().contains(ui->cboxKinds->currentText())) + ui->tbResult->hideRow(row); + } + if (ui->cboxSubject->currentText() != "所有") + { + if (!ui->tbResult->item(row,3)->text().contains(ui->cboxSubject->currentText())) + ui->tbResult->hideRow(row); + } + if (!ui->tbResult->item(row,1)->text().contains(ui->editName->text())) + ui->tbResult->hideRow(row); + } +} diff --git a/search/resultinfowindow.h b/search/resultinfowindow.h index 17a6a30..0e07512 100644 --- a/search/resultinfowindow.h +++ b/search/resultinfowindow.h @@ -1,7 +1,9 @@ #ifndef RESULTINFOWINDOW_H #define RESULTINFOWINDOW_H +#define TITLE "学生成绩管理系统" #include +#include "database.h" namespace Ui { class ResultInfoWindow; @@ -17,6 +19,9 @@ class ResultInfoWindow : public QMainWindow private: Ui::ResultInfoWindow *ui; + +public slots: + void search_result(); }; #endif // RESULTINFOWINDOW_H diff --git a/search/resultinfowindow.ui b/search/resultinfowindow.ui index 0541448..f0e1c1b 100644 --- a/search/resultinfowindow.ui +++ b/search/resultinfowindow.ui @@ -114,6 +114,11 @@ 成绩 + + + 编号 + + @@ -193,5 +198,53 @@ + + cboxKinds + currentIndexChanged(int) + btnQuery + click() + + + 434 + 20 + + + 674 + 18 + + + + + cboxSubject + currentIndexChanged(int) + btnQuery + click() + + + 591 + 19 + + + 674 + 18 + + + + + editName + returnPressed() + btnQuery + click() + + + 269 + 19 + + + 674 + 18 + + + diff --git a/search/studentinfowindow.cpp b/search/studentinfowindow.cpp index 4637ffa..e690c55 100644 --- a/search/studentinfowindow.cpp +++ b/search/studentinfowindow.cpp @@ -9,7 +9,7 @@ StudentInfoWindow::StudentInfoWindow(QWidget *parent) : this->setFixedSize(705,343); this->setWindowModality(Qt::ApplicationModal); this->setWindowFlags(Qt::Dialog); - Refresh_Table(ui->tbStudent,"student"); + Refresh_StudentInfo_Table_INITIAL(ui->tbStudent); QObject::connect(ui->btnQuery, &QPushButton::clicked, this, &this->search_student); } @@ -21,7 +21,7 @@ StudentInfoWindow::~StudentInfoWindow() void StudentInfoWindow::search_student() { - Refresh_Table(ui->tbStudent, "student"); + Refresh_StudentInfo_Table_INITIAL(ui->tbStudent); int col = ui->cboxCondition->currentIndex(); for (int row=0; rowtbStudent->rowCount(); row++) { diff --git a/settings/classeswindow.ui b/settings/classeswindow.ui index a9b462b..9312ff2 100644 --- a/settings/classeswindow.ui +++ b/settings/classeswindow.ui @@ -236,5 +236,21 @@ + + tbClass + doubleClicked(QModelIndex) + btnEdit + click() + + + 153 + 80 + + + 157 + 246 + + + diff --git a/settings/examkindswindow.ui b/settings/examkindswindow.ui index b3dc573..74155ec 100644 --- a/settings/examkindswindow.ui +++ b/settings/examkindswindow.ui @@ -203,5 +203,21 @@ + + tbKinds + doubleClicked(QModelIndex) + btnEdit + click() + + + 143 + 80 + + + 135 + 216 + + + diff --git a/settings/gradewindow.ui b/settings/gradewindow.ui index 7459347..fd5c04d 100644 --- a/settings/gradewindow.ui +++ b/settings/gradewindow.ui @@ -203,5 +203,21 @@ + + tbGrade + doubleClicked(QModelIndex) + btnEdit + click() + + + 140 + 80 + + + 132 + 216 + + + diff --git a/settings/subjectwindow.ui b/settings/subjectwindow.ui index 65c9fca..2da52cc 100644 --- a/settings/subjectwindow.ui +++ b/settings/subjectwindow.ui @@ -203,5 +203,21 @@ + + tbSubject + doubleClicked(QModelIndex) + btnEdit + click() + + + 140 + 80 + + + 132 + 216 + + +