feat: add login by enter and return button

This commit is contained in:
semenov
2024-09-30 12:41:23 +03:00
parent 6ac482be16
commit 57f4dea2a0
7 changed files with 18 additions and 0 deletions

2
StaticData/authData.xml Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuthData Login="FDS" Password="FSD" InstructorName="" ClientName="" AccessType=""/>

2
StaticData/temp.xml Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<ClientAutorization Login="FDS" Password="FSD"/>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -394,6 +394,17 @@ void MainWindow::checkUpdate()
ui->inlineTextDebug->setText(tr("Проверка обновлений..."));
}
void MainWindow::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)
{
if (ui->loginInputField->text().length() <= 0 || ui->passwordInputField->text() <= 0) return;
on_loginButton_clicked();
}
}
void MainWindow::painting()
{
// QPixmap background(":/resource/SSJ-100.jpg");

View File

@@ -104,5 +104,8 @@ private:
void loadStaticData();
void bindClient();
void createObjects();
protected:
virtual void keyPressEvent(QKeyEvent *event);
};
#endif // MAINWINDOW_H