PDA

View Full Version : how can i keep the original data when i edit the element in the table view?



yuyunfeng
29th March 2010, 07:40
I have just make a tool with Qt4. I have just made a subclass of QAbstractTableModel, and show the items with QTableView. When i double-clicked the item and start to edit the item, i found the original data was cleared while i wanted to keep it except i input some new data. Does some one have some advices?
P.S. sorry for my poor english.:p

axeljaeger
3rd April 2010, 15:47
In your ::data method, return the data to be shown in the edtor when asked for the Qt::EditRole.