forked from lwher/Library-System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborrow_book.cpp
More file actions
39 lines (37 loc) · 1.04 KB
/
Copy pathborrow_book.cpp
File metadata and controls
39 lines (37 loc) · 1.04 KB
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
#include "borrow_book.h"
#include "ui_borrow_book.h"
#include "class.h"
Borrow_book::Borrow_book(QWidget *parent) :
QWidget(parent),
ui(new Ui::Borrow_book)
{
ui->setupUi(this);
this->setAttribute(Qt::WA_TranslucentBackground, true);//透明
setWindowFlags(Qt::FramelessWindowHint);
}
Borrow_book::~Borrow_book()
{
delete ui;
}
void Borrow_book :: work()
{
QVector<Event> event;
enum type{id, user_id, user_name, book_id, book_name, start_time, end_time};
event_search(event, root.id, user_id);
int cnt;
while(cnt = ui -> borrow_table -> rowCount())
ui -> borrow_table -> removeRow(cnt - 1);
for(QVector <Event> :: iterator it = event.begin(); it != event.end(); ++it)
{
//(*it).printf();
ui -> borrow_table -> insertRow(cnt);
ui -> borrow_table -> setItem(cnt, 0, new QTableWidgetItem(it -> book_id));
ui -> borrow_table -> setItem(cnt, 1, new QTableWidgetItem(it -> book_name));
++cnt;
}
show();
}
void Borrow_book::on_pushButton_clicked()
{
close();
}