Multiple focus causing multiple event triggered
I made a dialog like this by Qt Designer.
The "QLineEdit B" and "button a" were both blue-bordered.
I connected the signal returnPressed() from "QLineEdit B" to function onInputEnterPressed(), and connected signal pressed() from "button a" to refreshInformation(). I noticed that when I finished fill QLineEdit B and press enter, both onInputEnterPressed() and refreshInformation() was triggered(which means the returnPressed() of "QLineEdit B" is emitted, and the pressed() signal from "button a" is also emitted, too). How can I do to prevent the refreshInformation() being triggered unexpectedly?
!http://img541.imageshack.us/img541/2944/3n02.png(here is a picture, if you can't see it, please report to me)!
Another question, Is that normal to have two focuses in identical window?
What is signal pressed() ?
Oh, I'm sorry. I forgot to provide the sender. The pressed() is a signal from QPushButton.
I connected the signal pressed() from button a to refreshInformation(), and connected the signal returnPressed() from QLineEdit B to onInputEnterPressed().
Are you sure that one function is not calling the other ?
Otherwise, can you share the relevant piece of code ?