qt/LedOK/passwordindlg.cpp
2023-05-08 09:59:15 +08:00

33 lines
1020 B
C++

#include "passwordindlg.h"
#include "base/changepasswordform.h"
#include "gutil/qgui.h"
#include <QLabel>
#include <QPushButton>
PasswordInChDlg::PasswordInChDlg(QWidget *parent) : QDialog(parent) {
resize(240, 150);
auto vBox = new VBox(this);
vBox->addStretch();
auto hBox = new HBox(vBox);
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();
btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
vBox->addWidget(btnBox);
}