PDA

View Full Version : Editing problem in QTreeView



ugurkoltuk
8th January 2010, 02:22
I have a QTreeView in my application. When user double clicks on an item to edit it's value, the value disappears and user finds himself/herself in a line-edit like something with no text at all. I want the user to be able to edit the text inside the item, without destroying it (i mean i want the user to see the text he is editing at the time of editing.) How can I do that?

Coises
8th January 2010, 03:11
I think you need to be sure the override of QAbstractItemModel::data in your model returns the text to be edited when asked for the Qt::EditRole (http://doc.trolltech.com/latest/qt.html#ItemDataRole-enum)

faldzip
8th January 2010, 08:09
are you using custom delegate?