collycrk
3rd September 2015, 16:52
I'm as green as a newbie can be to QT5,4.
The question I have concerns the form I have.
void ACemployee_Dialog::on_lineEdit_name_returnPressed( )
{
name = ui->lineEdit_name->text();
if(name == ""){
QMessageBox msgBox;
msgBox.setText("Name can not be blank, please enter a value.");
msgBox.exec();
ui->lineEdit_name->setFocus();
}
else {
ui->label_status->setText(name);
ui->lineEdit_address->setFocus();
}
}
It works well but i ran across a 'feature'. When filling out the lineEdit and an error is notice in a lineEdit above the current lineEdit above, and one clicks on the lineEdit
in question and corrects the error the form has to be reset.
The window does not have to be closed and reopen but one has to start from the beginning of the form.
Thanks in advance for your wisdom.
The question I have concerns the form I have.
void ACemployee_Dialog::on_lineEdit_name_returnPressed( )
{
name = ui->lineEdit_name->text();
if(name == ""){
QMessageBox msgBox;
msgBox.setText("Name can not be blank, please enter a value.");
msgBox.exec();
ui->lineEdit_name->setFocus();
}
else {
ui->label_status->setText(name);
ui->lineEdit_address->setFocus();
}
}
It works well but i ran across a 'feature'. When filling out the lineEdit and an error is notice in a lineEdit above the current lineEdit above, and one clicks on the lineEdit
in question and corrects the error the form has to be reset.
The window does not have to be closed and reopen but one has to start from the beginning of the form.
Thanks in advance for your wisdom.