-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidget.cpp
58 lines (50 loc) · 1.18 KB
/
widget.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
48
49
50
51
52
53
54
55
56
57
#include "widget.h"
#include "ui_widget.h"
#include "map.h"
#include <QWidget>
#include <QMouseEvent>
#include <QMessageBox>
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
this->setWindowTitle("民大地图导航");
// this->setWindowFlags(Qt::FramelessWindowHint);
this->setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
}
Widget::~Widget()
{
delete ui;
}
//退出按钮
void Widget::on_exitbtn_clicked()
{
this->close();
}
//登录按钮
void Widget::on_loginbtn_clicked()
{
QString admin = ui->adminLine->text();
QString password = ui->passwordLine->text();
map *son = new map();
int flag = 0;
if(admin == "101" && password == "123")
{
QMessageBox::information(this,"登录提示","登录成功");
this->close();
son->show();
flag = 1;
}
if(admin == "" || password == "")
{
QMessageBox::information(this,"登录提示","账号或者密码不能为空");
}
else
{
if(flag = 0)
{
QMessageBox::information(this,"登录提示","登录失败");
}
}
}