LoginWidget.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef LOGINWIDGET_H
  2. #define LOGINWIDGET_H
  3. #include <QWidget>
  4. class LineEdit;
  5. class PasswordLineEdit;
  6. class CheckBox;
  7. class PushButton;
  8. class QVBoxLayout;
  9. class QLabel;
  10. class QHBoxLayout;
  11. class LoginWidget : public QWidget
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit LoginWidget(QWidget *parent = nullptr);
  16. void setTitle(const QString title);
  17. const QString account() const;
  18. const QString password() const;
  19. bool rememberPassword() const;
  20. void saveAccountConfig() const;
  21. private:
  22. void initialize();
  23. void initLayout();
  24. void connectSignalsAndSlots();
  25. void loadAccount();
  26. signals:
  27. void signalLogin();
  28. void signalCancel();
  29. private:
  30. QVBoxLayout *m_vBoxLayout = nullptr;
  31. QLabel *m_titleLabel = nullptr;
  32. LineEdit *m_accLineEdit = nullptr;
  33. PasswordLineEdit *m_pwLineEdit = nullptr;
  34. QHBoxLayout *m_remLayout = nullptr;
  35. CheckBox *m_remCheckBox = nullptr;
  36. QHBoxLayout *m_buttonLayout = nullptr;
  37. PushButton *m_loginButton = nullptr;
  38. PushButton *m_cancelButton = nullptr;
  39. };
  40. #endif // LOGINWIDGET_H