-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
43 lines (32 loc) · 843 Bytes
/
Copy pathmain.cpp
File metadata and controls
43 lines (32 loc) · 843 Bytes
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
#include "mainwindow.h"
#include <QApplication>
#include "logindialog.h"
#include <QString>
class ex{
public:
int a;
int b;
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
//w.show();
//return a.exec();
logindialog dlg;
QVector<ex> ex_vec;
ex ex_1;
ex_1.a=1;
ex_1.b=2;
ex ex_2;
ex_2.a=4;
ex_2.b=3;
ex_vec.push_back(ex_1);
ex_vec.push_back(ex_2);
if(dlg.exec() == QDialog::Accepted) // 利用Accepted返回值判断按钮是否被按下
{
w.show(); // 如果被按下,显示主窗口
return a.exec(); // 程序一直执行,直到主窗口关闭
}
else return 0; //如果没被按下,则不会进入主窗口,整个程序结束运行
}