View Full Version : How to use ENTER key on QListWidget

13th September 2010, 11:37
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.

13th September 2010, 11:45
Set appropriate QAbstractItemView::editTriggers on your list widget.

13th September 2010, 12:26
Hey I didn't get you.
Can you please provide a small example for it?

13th September 2010, 14:05
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.