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.)
connect(this->pushButton_Cancel, SIGNAL(clicked()), this, SLOT(myReject()));
connect(this->lineEdit_DriverCode, SIGNAL(editingFinished()), this, SLOT(checkDriverCode()));
connect(this->pushButton_Cancel, SIGNAL(clicked()), this, SLOT(myReject()));
connect(this->lineEdit_DriverCode, SIGNAL(editingFinished()), this, SLOT(checkDriverCode()));
To copy to clipboard, switch view to plain text mode
current processing:- Enter invalid data in the lineedit widget.
- Press the cancel button. (I think this actually happens after line 3.)
- The lineedit widget loses focus and causes the editingFinished signal to be emitted. (checkDriverCode called)
- 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.
Bookmarks