PDA

View Full Version : An intro I do at LineEdit is processed as a mouseclick



tonnot
11th October 2011, 14:11
I have an icon (a pushbutton) to open a text file. (the mousepressed is used)
Into the same frame where I have other widgets (icons-pushbutton) I have a QlineEdit to write a line number and I have connected the returnPressed to do some things.
After proccess the comands linked to this event (place the cursor at the right position) I give the focus to the QtextEdit where I'm viewing the file.

Ok, I dont know how, but the same event linked with the last mousepressed event (the pushbutton-icon to open a file) is launched.... ??????

I have placed another lineEdit without returnPressed conected and the same occurs. (If I press return )
What is happen?

Lykurg
11th October 2011, 14:30
Have you set a buddy? Can we see your code?

wysota
11th October 2011, 16:09
Make sure the button has the "default" and "autoDefault" properties set to false.

tonnot
13th October 2011, 12:53
Yes that is the solution.
However, I have observed a strange behavior if I dont set the buttons to true and false again. ( I I have cleaned my project).
Thanks