ok, the problem is in Disp:: openDatumForm in this line
Qt Code:
  1. ...
  2. if(datumform.exec() == QDialog::Accepted)
  3. ...
To copy to clipboard, switch view to plain text mode 
when you close this dialog by Alt+F4 then the result of exec will be QDialog::Rejected and you pass this block
Qt Code:
  1. {
  2. DatumVal = Datumno_Val;
  3. XVal = Xdatum_Val;
  4. YVal = Ydatum_Val;
  5. ZVal = Zdatum_Val;
  6. datuminitial();
  7. }
To copy to clipboard, switch view to plain text mode 
there is two ways:
add a "OK" button in that dialog and connect signal QPushButton::clicked with QDialog::accept and leave this code unchanged
Qt Code:
  1. void Disp::openDatumForm()
  2. {
  3. DatumForm datumform(this);
  4. datumform.move(35, 90);
  5. if(datumform.exec() == QDialog::Accepted) {
  6. DatumVal = Datumno_Val;
  7. XVal = Xdatum_Val;
  8. YVal = Ydatum_Val;
  9. ZVal = Zdatum_Val;
  10. datuminitial();
  11. }
  12. }
To copy to clipboard, switch view to plain text mode 
the second ways is: to use code like this
Qt Code:
  1. void Disp::openDatumForm()
  2. {
  3. DatumForm datumform(this);
  4. datumform.move(35, 90);
  5. datumform.exec();
  6. DatumVal = Datumno_Val;
  7. XVal = Xdatum_Val;
  8. YVal = Ydatum_Val;
  9. ZVal = Zdatum_Val;
  10. datuminitial();
  11. }
To copy to clipboard, switch view to plain text mode 
in this case there is no need to add extra button in the dialog, but you also lose checking of the dialog acception or rejection.