Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Simple override of the QDialog closeEvent(); determing whether user hit OK or Cancel ...



  • Hello,

    Title says it all; I have the following code snippet:

    @
    void QTTestDialog::closeEvent(QCloseEvent *event) {

    }
    @

    I know how to get this event to fire; but how do I determine whether the user has hit OK or Cancel in my custom QDialog?

    I couldn't find out the answer to this via searching Google or the forums, perhaps I searched the wrong place.

    Thank you for your time.



  • int QDialog::result() const


Log in to reply