qt/LedOK/passwordindlg.cpp

33 lines
1020 B
C++
Raw Normal View History

2023-04-18 14:14:46 +08:00
#include "passwordindlg.h"
#include "base/changepasswordform.h"
2023-05-05 17:22:54 +08:00
#include "gutil/qgui.h"
2023-04-18 14:14:46 +08:00
#include <QLabel>
#include <QPushButton>
2023-05-05 17:22:54 +08:00
PasswordInChDlg::PasswordInChDlg(QWidget *parent) : QDialog(parent) {
resize(240, 150);
auto vBox = new VBox(this);
2023-04-18 14:14:46 +08:00
vBox->addStretch();
2023-05-05 17:22:54 +08:00
auto hBox = new HBox(vBox);
2023-04-18 14:14:46 +08:00
hBox->addWidget(new QLabel(tr("Input password")));
fdPassword = new QLineEdit();
fdPassword->setEchoMode(QLineEdit::Password);
fdPassword->setFocus();
hBox->addWidget(fdPassword);
btnChangePassword = new QPushButton(tr("Change Password"));
vBox->addWidget(btnChangePassword, 0, Qt::AlignRight);
connect(btnChangePassword, &QPushButton::clicked, this, [this]() {
ChangePasswordForm dlg(this);
dlg.exec();
});
vBox->addStretch();
2023-05-05 17:22:54 +08:00
btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
2023-04-18 14:14:46 +08:00
connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
2023-05-08 09:59:15 +08:00
vBox->addWidget(btnBox);
2023-04-18 14:14:46 +08:00
}