onRejected doesn't trigger on Discard Use the appropriate buttonClicked signal and close the dialog on reject