I have a QDialog box which accepts password and has a Ok button. When closing the Dialog box on "X", a function should be called. But that function is being called even if clicked on Ok button. Qdialog exec function is always returning Rejected. Code:
if (password->exec() == QDialog::Accepted) {
QString passwordText = passwordEntry->text();
}
else
{
sshDialogBoxClosed();
}
delete password;
In any case sshDialogBoxClosed() function is being called. Please help me to resolve this issue. Thanks in Advance
You need to connect the "Ok" button with the "accept" slot and the "Cancel" button with the "reject" slot.