Results 1 to 3 of 3

Thread: Enter key causing program to exit

  1. #1
    Join Date
    Mar 2006
    Posts
    2
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Enter key causing program to exit

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Enter key causing program to exit

    Maybe you are using a QDialog and have a button which is marked as being default, thus closing the dialog when you hit Enter?

  3. #3
    Join Date
    Mar 2006
    Posts
    2
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Enter key causing program to exit

    Thank you Wysota! That worked. I was pulling my hair out and getting really angry at QT.

    Thanks for helping a novice QT programmer.

Similar Threads

  1. Quit, Exit qApp (program) if error?
    By Arsenic in forum Newbie
    Replies: 13
    Last Post: 30th September 2008, 13:59
  2. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 07:13
  3. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 05:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.