hi to all, I've centos7.5 and Qt 5.7 in VM. I am building a small project in this i shows a form in click on button of first form. On second form there is a "on_lineEditYesNo_returnPressed()" slot. this having following code :-
void dialogBill::on_lineEditYesNo_returnPressed()
{
ch = ui->lineEditYesNo->text().toUpper().trimmed();
if( (QString::compare(ch, yn1, Qt
::CaseInsensitive)) == 0 ) {
ui->lineEditEnterMembershipNumber->setDisabled(false);
ui->lineEditEnterCardNumber->setDisabled(false);
ui->lineEditYesNo->setText("");
ui->pushButtonReturnToMenu->setVisible(true);
ui->pushButtonReturnToMenu->setEnabled(true);
}
else if( (QString::compare(ch, yn2, Qt
::CaseInsensitive)) == 0) {
ui->lineEditYesNo->setText("");
ui->pushButtonReturnToMenu->setEnabled(false);
parentWidget()->show();
}
}
void dialogBill::on_lineEditYesNo_returnPressed()
{
QString ch;
QString yn1 = "y";
QString yn2 = "n";
ch = ui->lineEditYesNo->text().toUpper().trimmed();
if( (QString::compare(ch, yn1, Qt::CaseInsensitive)) == 0 )
{
ui->lineEditEnterMembershipNumber->setDisabled(false);
ui->lineEditEnterCardNumber->setDisabled(false);
ui->lineEditYesNo->setText("");
ui->pushButtonReturnToMenu->setVisible(true);
ui->pushButtonReturnToMenu->setEnabled(true);
}
else if( (QString::compare(ch, yn2, Qt::CaseInsensitive)) == 0)
{
ui->lineEditYesNo->setText("");
ui->pushButtonReturnToMenu->setEnabled(false);
parentWidget()->show();
}
}
To copy to clipboard, switch view to plain text mode
problem is that after execution of this slot ( reaching at end ) this second form automatically closes. I don't want to do this.
please have any suggestion.
Bookmarks