I got an issue with a QLineEdit. Even if I set the tab order to start at this line edit, once the screen is loaded the LIne Edit won't get the focus automatically.
I've also tried with this two lines :
this->activateWindow();
this->lineEdit_password->setFocus();
But this has still no effect. So maybe someone experienced the same issue...
Thanks in advance for your help, Boris
Thank you very much Krsna, overriding the showEvent() of the qwidget will work :
void OScreenLogin::showEvent(QShowEvent* e){
this->activateWindow();
this->lineEdit_password->setFocus();
QWidget::showEvent(e);
}
The lineEdit gets the focus, I guess that an other widget had the focus set after these two lines. Thanks again, Boris
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With