-
Notifications
You must be signed in to change notification settings - Fork 0
/
startwindow.h
48 lines (37 loc) · 1.38 KB
/
startwindow.h
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
#pragma once
#include <qregularexpression.h>
#include <qtimer.h>
#include <qvalidator.h>
#include <qwidget.h>
#include <qpainter.h>
#include "ui_startwindow.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class StartWindowClass;
};
QT_END_NAMESPACE
class StartWindow : public QWidget {
Q_OBJECT
public:
StartWindow(QWidget *parent = nullptr);
~StartWindow() { delete ui; }
private:
Ui::StartWindowClass *ui;
bool flag; /* true为登录状态, false为注册状态 */
QTimer *errorShowTimer; /* 错误信息展示时间计时器 */
void showError(const QString &error); /* 展示错误信息 */
//void paintEvent(QPaintEvent *event) override; /* 绘制背景 */
public slots:
void onSignupSuccess(quint64 id); /* 响应注册成功 */
void onSignupFail(const QString &error); /* 响应注册失败 */
void onLoginSuccess(const QString &nickname); /* 响应登录成功 */
void onLoginFail(const QString &error); /* 响应登录失败 */
private slots:
void onShiftButton(); /* 响应切换按钮 */
void onSubmitButton(); /* 响应提交按钮 */
signals:
void signupRequest(const QString &nickname,
const QString &password); /* 请求注册 */
void loginRequest(quint64 id, const QString &password); /* 请求登录 */
void loginSuccess(quint64 id, const QString &nickname); /* 登录成功 */
};