tlogin.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef TLOGIN_H
  2. #define TLOGIN_H
  3. #include <QDialog>
  4. #include "qpushbutton.h"
  5. class QLineEdit;
  6. class QLabel;
  7. class QCheckBox;
  8. class TLogin : public QDialog
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit TLogin(QWidget *parent = nullptr);
  13. void on_login_clicked();
  14. void on_offline_login_clicked(); // 添加离线登录槽函数
  15. void on_refresh_captcha_clicked(); // 刷新验证码
  16. protected:
  17. void mousePressEvent(QMouseEvent *event);
  18. void mouseMoveEvent(QMouseEvent *event);
  19. signals:
  20. void loginSuccessful();
  21. private:
  22. QPoint m_dragPosition;
  23. QPushButton *loginPushButton;
  24. QPushButton *offlineLoginButton; // 添加离线登录按钮
  25. QLineEdit *usernameEdit;
  26. QLineEdit *passwordEdit;
  27. QLineEdit *captchaEdit;
  28. QCheckBox *rememberUsernameCheckBox; // 添加记住用户名复选框
  29. class CaptchaLabel *captchaImage;
  30. QLabel *info;
  31. QString captchaId; // 存储验证码ID
  32. void getCaptcha(); // 获取验证码
  33. void loadSavedUsername(); // 加载保存的用户名
  34. };
  35. #endif // TLOGIN_H