ok, the problem is in Disp:: openDatumForm in this line
...
if(datumform.
exec() == QDialog::Accepted) ...
...
if(datumform.exec() == QDialog::Accepted)
...
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
{
DatumVal = Datumno_Val;
XVal = Xdatum_Val;
YVal = Ydatum_Val;
ZVal = Zdatum_Val;
datuminitial();
}
{
DatumVal = Datumno_Val;
XVal = Xdatum_Val;
YVal = Ydatum_Val;
ZVal = Zdatum_Val;
datuminitial();
}
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
void Disp::openDatumForm()
{
DatumForm datumform(this);
datumform.move(35, 90);
if(datumform.
exec() == QDialog::Accepted) { DatumVal = Datumno_Val;
XVal = Xdatum_Val;
YVal = Ydatum_Val;
ZVal = Zdatum_Val;
datuminitial();
}
}
void Disp::openDatumForm()
{
DatumForm datumform(this);
datumform.move(35, 90);
if(datumform.exec() == QDialog::Accepted) {
DatumVal = Datumno_Val;
XVal = Xdatum_Val;
YVal = Ydatum_Val;
ZVal = Zdatum_Val;
datuminitial();
}
}
To copy to clipboard, switch view to plain text mode
the second ways is: to use code like this
void Disp::openDatumForm()
{
DatumForm datumform(this);
datumform.move(35, 90);
datumform.exec();
DatumVal = Datumno_Val;
XVal = Xdatum_Val;
YVal = Ydatum_Val;
ZVal = Zdatum_Val;
datuminitial();
}
void Disp::openDatumForm()
{
DatumForm datumform(this);
datumform.move(35, 90);
datumform.exec();
DatumVal = Datumno_Val;
XVal = Xdatum_Val;
YVal = Ydatum_Val;
ZVal = Zdatum_Val;
datuminitial();
}
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.
Bookmarks