PDA

View Full Version : How to use ENTER key on QListWidget



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

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

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

wysota
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.