-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestion_edit.cpp
More file actions
61 lines (47 loc) · 1.2 KB
/
Copy pathquestion_edit.cpp
File metadata and controls
61 lines (47 loc) · 1.2 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
50
51
52
53
54
55
56
57
58
59
60
#include "question_edit.h"
#include "ui_question_edit.h"
#include"settings.h"
#include<QMessageBox>
#include<QList>
#include"user_info.h"
extern QMap <QString,QString>corre;
extern QList <USER> list;
extern USER succeed;//单独全局变量已登录的用户
question_edit::question_edit(QWidget *parent) :
QDialog(parent),
ui(new Ui::question_edit)
{
ui->setupUi(this);
this->setWindowTitle("编辑问题");
}
question_edit::~question_edit()
{
delete ui;
}
void question_edit::on_cancel_clicked()
{
this->close();
Settings *pic=new Settings;
pic->show();
}
void question_edit::on_sure_clicked()
{
int flag=1;
QString que=ui->question->text();
if(que==NULL)QMessageBox::critical(this,tr("提示"),tr("设置的问题不能为空!")),flag=0;
else {
if(que.indexOf(" ")!=-1)QMessageBox::critical(this,tr("警告"),tr("问题中不能有空格!")),flag=0;
else {
succeed.question=que;
succeed.verti_way=0;
}
}
for(int i=0;i<list.size();i++){
if(list[i].phone==succeed.phone)list[i]=succeed;
}
if(flag==1){
this->close();
Settings *pic=new Settings;
pic->show();
}
}