Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Push button clicked event executed simultaneously with returnedPressed() event of a LineEdit - *SOLVED*
Raim last edited by Raim
I've made a form with two QListWidgets, a Line Edit field, and a Push Button. Using the returnPressed() event from the LineEdit, I add items to the first QListWidget; afterwards, I should use the button to trim out any duplicates and add the new list to the second QListWidget. Problem is, everytime I press Enter in the LineEdit field, the clicked() event of the button is also executed. I see no reason for this to happen, and if anyone might shed light for me on this, it'd be great.
EDIT: I know now why this problem happens. It appears when I press the Enter key it also presses the first available push button. Seems unnecessary to me, but I worked around with a switch bool variable.