Results 1 to 6 of 6

Thread: dateEdit, editingFinished, isolate return key press

  1. #1
    Join Date
    May 2010
    Location
    Bangalore, India.
    Posts
    28
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default dateEdit, editingFinished, isolate return key press

    Hi
    I need the functionality that in dateEdit after enter key press the date should be stored in DB,

    & if a return key pressed the date shold not be enterd in the DB.(as i din't wanted to add a

    button.)

    currently i am using the slot "editingFinished()" (on_dateEdit_editingFinished())
    This signal is emitted when the Return or Enter key is pressed or the line edit loses focus.

    i din't find any other signal which does my work..
    is there any other signal or any other method to do the job..?

    void FrontScreen:n_dateEdit_editingFinished()
    {
    execute the req query & do the required things
    }

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: dateEdit, editingFinished, isolate return key press

    Use the key press event.

    But, the following worries me deeply:
    Quote Originally Posted by meena View Post
    I need the functionality that in dateEdit after enter key press the date should be stored in DB,
    & if a return key pressed the date shold not be enterd in the DB.(as i din't wanted to add a
    button.)
    That is weird behaviour and I can guarantee you it would annoy me a lot.

  3. #3
    Join Date
    May 2010
    Location
    Bangalore, India.
    Posts
    28
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: dateEdit, editingFinished, isolate return key press

    what is weird behaviour here?

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: dateEdit, editingFinished, isolate return key press

    Quote Originally Posted by meena View Post
    what is weird behaviour here?
    Return for adding to the database
    Enter for not adding to the database.

    At least use Esc to discard changes.

    Return or enter should always be used for confirmation. And different behavior between them should always be visible.

  5. #5
    Join Date
    May 2010
    Location
    Bangalore, India.
    Posts
    28
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: dateEdit, editingFinished, isolate return key press

    sorry my mistake.. I meant on Esc & Enter key press the changes are updated, but i wanted to Esc to discard changes.. as the default behavior of slot "editingFinished()" (on_dateEdit_editingFinished())
    This signal is emitted when the Return or Enter key is pressed or the line edit loses focus.

    i din't find any other signal which does my work..
    is there any other signal or any other method to do the job..?

  6. #6
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: dateEdit, editingFinished, isolate return key press

    Quote Originally Posted by meena View Post
    i din't find any other signal which does my work..
    is there any other signal or any other method to do the job..?
    I think I'm going to repeat myself.
    You can use the key press event.

Similar Threads

  1. QComboBox editingFinished
    By aekilic in forum Qt Programming
    Replies: 6
    Last Post: 28th November 2020, 08:17
  2. editingFinished of QLineEdit
    By weixj2003ld in forum Qt Programming
    Replies: 1
    Last Post: 3rd November 2009, 09:06
  3. QDialog, editingFinished, and Cancel Button.
    By jeffpogo in forum Qt Programming
    Replies: 8
    Last Post: 3rd June 2009, 03:22
  4. Ignoring "editingFinished" when closing application
    By ^NyAw^ in forum Qt Programming
    Replies: 5
    Last Post: 15th April 2008, 16:40
  5. editingFinished() signal
    By jamadagni in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 05:39

Tags for this Thread

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.