PDA

View Full Version : Edit items in table model



gyre
13th January 2008, 03:25
Hi , I have a question...
I have a table model...working fine...
the only thing that makes me a bit angry is that everytime when I try to edit items there is no way I can add new data to the ones that it already contains it...when I try to edit data in an item the old value that is stored in it gets disappeared and I get empty item with blinking cursor...yes If i press Esc the old value gets displayed...
What I want is standard behaviour of table editor->> when I double click the item I want EDIT the value not INSERT NEW value in edited item...
Anyone idea ?
THanks !

my model implementation is in attachement

jacek
13th January 2008, 21:25
Make your model return the same data for Qt::EditRole as for Qt::DisplayRole and just to be sure, try ModelTest (http://labs.trolltech.com/page/Projects/Itemview/Modeltest).

gyre
14th January 2008, 03:08
Make your model return the same data for Qt::EditRole as for Qt::DisplayRole and just to be sure, try ModelTest (http://labs.trolltech.com/page/Projects/Itemview/Modeltest).

Thanks man...returning the same data for Edit and Display roles helpes...
PLUS, that modeltest thing is cool..
Thanks :)