@@ -1027,7 +1027,14 @@ void LoginForm::keyPressEvent(QKeyEvent *event)
1027
1027
1028
1028
if (event->key () == Qt::Key_Return || event->key () == Qt::Key_Enter) {
1029
1029
1030
+
1031
+
1030
1032
winClicked = false ;
1033
+
1034
+ if (justshowed){
1035
+ justshowed = false ;
1036
+ return ;
1037
+ }
1031
1038
if (ui->stackedWidget ->currentIndex () == ui->stackedWidget ->indexOf (ui->resetpage ))
1032
1039
on_resetpasswordButton_clicked ();
1033
1040
else if (ui->stackedWidget ->currentIndex () == ui->stackedWidget ->indexOf (ui->warningpage )){
@@ -1043,10 +1050,9 @@ void LoginForm::keyPressEvent(QKeyEvent *event)
1043
1050
ui->passwordInput ->setFocus ();
1044
1051
} else if (ui->userInput ->hasFocus () && !ui->userInput ->isHidden () && ui->passwordInput ->text ().isEmpty ()){
1045
1052
ui->passwordInput ->setFocus ();
1046
- }else {
1053
+ }else {
1047
1054
startLogin ();
1048
1055
}
1049
-
1050
1056
}
1051
1057
}
1052
1058
else if (event->key () == Qt::Key_Escape) {
@@ -1092,7 +1098,7 @@ void LoginForm::keyPressEvent(QKeyEvent *event)
1092
1098
QWidget::keyPressEvent (event);
1093
1099
}
1094
1100
1095
-
1101
+ justshowed = false ;
1096
1102
}
1097
1103
1098
1104
void LoginForm::keyReleaseEvent (QKeyEvent *event){
@@ -2491,6 +2497,7 @@ void LoginForm::hideAll(void){
2491
2497
// ui->usersframe->hide();
2492
2498
// ui->userspage->hide();
2493
2499
ui->passwordInput ->hide ();
2500
+ ui->passwordInput ->clearFocus ();
2494
2501
// ui->userInput->hide();
2495
2502
2496
2503
hide ();
@@ -2518,9 +2525,14 @@ void LoginForm::showAll(void){
2518
2525
ui->passwordInput ->setFocus ();
2519
2526
else
2520
2527
ui->userInput ->setFocus ();
2521
-
2528
+ justshowed = true ;
2522
2529
}
2523
2530
2524
2531
ishidden = false ;
2525
2532
}
2526
2533
2534
+
2535
+ void LoginForm::on_passwordInput_textEdited (const QString &arg1)
2536
+ {
2537
+ justshowed = false ;
2538
+ }
0 commit comments