-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathidofchangebook.cpp
More file actions
49 lines (44 loc) · 1.08 KB
/
Copy pathidofchangebook.cpp
File metadata and controls
49 lines (44 loc) · 1.08 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
40
41
42
43
44
45
46
47
48
49
#include "idofchangebook.h"
#include "ui_idofchangebook.h"
#include "allclass.h"
#include "changebook.h"
#include <QMessageBox>
idofchangebook::idofchangebook(QWidget *parent) :
QDialog(parent),
ui(new Ui::idofchangebook)
{
ui->setupUi(this);
}
idofchangebook::~idofchangebook()
{
delete ui;
}
bool isBook3(QString bookID);
extern book_shelf library;
string changebookid;
void idofchangebook::on_pushButton_clicked()
{
QString idofbook = ui->changebookID->text();
changebookid = idofbook.toStdString();
if(!isBook3(idofbook))
QMessageBox::warning(this,"警告!",
"该书不存在!",
QMessageBox::Yes);
else
{
changebook *changeb = new changebook();
changeb->setModal(true);
changeb->show();
this->close();
}
}
bool isBook3(QString bookID)
{
for(int i = 0; i<library.booklib.size();++i)
{
QString q1 = QString::fromStdString(library.booklib[i].id);
if(!QString::compare(bookID,q1))
return true;
}
return false;
}