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 :-
Qt Code:
  1. void dialogBill::on_lineEditYesNo_returnPressed()
  2. {
  3. QString ch;
  4. QString yn1 = "y";
  5. QString yn2 = "n";
  6. ch = ui->lineEditYesNo->text().toUpper().trimmed();
  7.  
  8. if( (QString::compare(ch, yn1, Qt::CaseInsensitive)) == 0 )
  9. {
  10. ui->lineEditEnterMembershipNumber->setDisabled(false);
  11. ui->lineEditEnterCardNumber->setDisabled(false);
  12. ui->lineEditYesNo->setText("");
  13. ui->pushButtonReturnToMenu->setVisible(true);
  14. ui->pushButtonReturnToMenu->setEnabled(true);
  15. }
  16. else if( (QString::compare(ch, yn2, Qt::CaseInsensitive)) == 0)
  17. {
  18. ui->lineEditYesNo->setText("");
  19. ui->pushButtonReturnToMenu->setEnabled(false);
  20. parentWidget()->show();
  21. }
  22. }
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.