I have a form with a lineedit widget that calls a function to validate the data on the signal editingFinished.

... but I do not want the lineedit to be validated if the cancel button is pressed. (I just want cancel to mean "Cancel -- Abort" no data validation.)

Qt Code:
  1. connect(this->pushButton_Cancel, SIGNAL(clicked()), this, SLOT(myReject()));
  2. connect(this->lineEdit_DriverCode, SIGNAL(editingFinished()), this, SLOT(checkDriverCode()));
To copy to clipboard, switch view to plain text mode 



current processing:
  1. Enter invalid data in the lineedit widget.
  2. Press the cancel button. (I think this actually happens after line 3.)
  3. The lineedit widget loses focus and causes the editingFinished signal to be emitted. (checkDriverCode called)
  4. I can not tell the cancel button was pressed from checkDriverCode because the editingFinished is called before the cancel button pressed registers.
Any ideas to help.

Thank you, Jeff.