Results 1 to 4 of 4

Thread: How to use ENTER key on QListWidget

  1. #1
    Join Date
    Aug 2010
    Posts
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How to use ENTER key on QListWidget

    Hi,
    I am a beginner to QT.
    I want to use a QListWidget in my application in which I will add names when I click on "add Name" button.
    Now my problem is I want to provide facility to edit the name of the selected item when user double click on that item.
    I don't want Enter key to work on any other widget.
    And after editing the name user can save the new name just by clicking the enter key.
    So can anyone guide me how can I use enter key to save the edited name.

    Thanks in Advance.
    Sanket

  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: How to use ENTER key on QListWidget

    Set appropriate QAbstractItemView::editTriggers on your list widget.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2010
    Posts
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use ENTER key on QListWidget

    Hey I didn't get you.
    Can you please provide a small example for it?

  4. #4
    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: How to use ENTER key on QListWidget

    Follow the link I gave you, see various edit triggers and set the ones you need on your view. There is no need for an example, the call you have to make is described under the given link.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to disable enter
    By phillip_Qt in forum Qt Programming
    Replies: 11
    Last Post: 23rd August 2012, 07:52
  2. QTextBrowser and ENTER key
    By szarek in forum Qt Programming
    Replies: 5
    Last Post: 10th July 2010, 20:47
  3. Replies: 1
    Last Post: 14th September 2008, 23:05
  4. Widget enter event
    By bunjee in forum Qt Programming
    Replies: 5
    Last Post: 20th April 2008, 22:40
  5. QEvent::Enter
    By incapacitant in forum Newbie
    Replies: 6
    Last Post: 22nd March 2006, 08:07

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.