I'm trying to figure out how to create a list view (either a plain QListView or a QListViewWidget, I suppose) which allowss the user to edit the item names.

For example, the list has three items, the user double-clicks (or, more appropriately, clicks twice) on an item and the text for that item turns into a text box, which the user can then edit. When the user presses enter or changes focus from the box, the text box turns back into plain text with the new name.

Ideally, when we first add an item to the list, it will start out in "rename mode" so that the user can give that item a name. So the user clicks the "add [item]" button, a new item appears on the list in "rename mode", they enter in the item's name, hit enter, and then new item finally turns into regular text with the user's name.

Google and the forum's search function are of no help here; searching "qlistview rename" doesn't return what I'm looking for. It does look like QT3 supported this more easily, but I'm using 4.6. I'm a QT newbie, though, so I may very well be missing something obvious.