PDA

View Full Version : problem with LineEdits and keyPressEvents



impeteperry
5th November 2007, 02:53
Hi
I have 5 QLineEdit widgets in a row with some labels between some of them. The user may enter some text in any one of them at his option. How do I determine which widget he/she was using when the return key was pressed?

I am running Kubuntu 7.04, qt4

Thanks

marcel
5th November 2007, 09:11
You can either use a QSignalMapper or use the sender() object in the slot connected to returnPressed() or whatever.
When using sender() you have to compare it with all your line edits in order to see which one sent the signal.

impeteperry
5th November 2007, 23:12
as soon as I sent the last post, I solved my problem using "textChanged" and "textEdited"
Thanks