PDA

View Full Version : Enter key causing program to exit



welby
8th March 2006, 23:15
Hello,

I am new to QT programming, so bear with me. I am writing a simple program (or so I thought) to learn QT. I am experiencing a problem when my program runs. I have a QLineEdit box to accept text that gets displayed in a QLabel. Problem is, if you press the enter key after you tyope in your text, the program exits. Fo that fact, if you press enter while focused on a checkbox, the program exits.

Any ideas how to stop this or why it's happening? I have treid capturing the enterpressed signal from the QLineEdit, but it did not help.

wysota
8th March 2006, 23:17
Maybe you are using a QDialog and have a button which is marked as being default, thus closing the dialog when you hit Enter?

welby
9th March 2006, 16:11
Thank you Wysota! That worked. I was pulling my hair out and getting really angry at QT.

Thanks for helping a novice QT programmer.