mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
refact1
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
#include <QRegExpValidator>
|
||||
#include <QToolTip>
|
||||
#include "dialogauthorization.h"
|
||||
#include "ui_dialogauthorization.h"
|
||||
|
||||
DialogAuthorization::DialogAuthorization(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogAuthorization)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->editLogin->setProperty("mandatoryField", true);
|
||||
ui->editPassword->setProperty("mandatoryField", true);
|
||||
|
||||
ui->btnViewPassword->setObjectName("btnViewPassword");
|
||||
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
|
||||
|
||||
ui->editLogin->setValidator(new QRegExpValidator(QRegExp("[A-Za-z\\d]+"), this));
|
||||
}
|
||||
|
||||
DialogAuthorization::~DialogAuthorization()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
QString DialogAuthorization::getLogin()
|
||||
{
|
||||
return ui->editLogin->text();
|
||||
}
|
||||
|
||||
void DialogAuthorization::setLogin(QString login)
|
||||
{
|
||||
ui->editLogin->setText(login);
|
||||
}
|
||||
|
||||
QString DialogAuthorization::getPassword()
|
||||
{
|
||||
return ui->editPassword->text();
|
||||
}
|
||||
|
||||
void DialogAuthorization::setPassword(QString password)
|
||||
{
|
||||
ui->editPassword->setText(password);
|
||||
}
|
||||
|
||||
void DialogAuthorization::on_btnLogIn_clicked()
|
||||
{
|
||||
this->accept();
|
||||
}
|
||||
|
||||
void DialogAuthorization::on_btnViewPassword_pressed()
|
||||
{
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Normal);
|
||||
}
|
||||
|
||||
void DialogAuthorization::on_btnViewPassword_released()
|
||||
{
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
|
||||
}
|
||||
|
||||
void DialogAuthorization::on_editLogin_inputRejected()
|
||||
{
|
||||
QToolTip::showText(QCursor::pos(),tr("Only Latin letters and numbers"));
|
||||
}
|
||||
Reference in New Issue
Block a user