-
Notifications
You must be signed in to change notification settings - Fork 0
/
teachermanageclassrooms.cpp
47 lines (39 loc) · 1.18 KB
/
teachermanageclassrooms.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "teachermanageclassrooms.h"
#include "ui_teachermanageclassrooms.h"
#include "teachermenu.h"
teachermanageclassrooms::teachermanageclassrooms(QWidget *parent) :
QWidget(parent),
ui(new Ui::teachermanageclassrooms)
{
ui->setupUi(this);
model = new QSqlTableModel(this, db);
showTable();
}
teachermanageclassrooms::~teachermanageclassrooms()
{
delete ui;
}
void teachermanageclassrooms::showTable()
{
queryClassroomByState(NULL);
ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->tableView->setModel(model);
ui->tableView->show();
}
void teachermanageclassrooms::query()
{
QString queryCondition = ui->query_condition->currentText();
queryCondition.compare("所有") == 0 ? queryCondition = NULL : NULL;
queryClassroomByState(queryCondition);
ui->query_condition->setCurrentIndex(0);
}
void teachermanageclassrooms::queryClassroomByState(QString state)
{
utils_table->setTableByFilteClassroomState(model, "classroom", state);
}
void teachermanageclassrooms::back()
{
this->hide();
teachermenu *teacher = new teachermenu;
teacher->show();
}