I have QTreeWidget, i set for item delegate:

Qt Code:
  1. tree.setItemDelegate(new TimeEdit(tree));
To copy to clipboard, switch view to plain text mode 

as in below code i set editor data and model data properly.

Qt Code:
  1. public void setModelData(QWidget editor, QAbstractItemModel model, QModelIndex index) {
  2. model.setData(index, ((QTimeEdit)editor).time());
  3. System.out.println("setModelData: " + ((QTimeEdit)editor).time());
  4.  
  5. QTreeWidget tree = (QTreeWidget) model.parent();
  6. System.out.println(tree);
  7. QTreeWidgetItem item = tree.currentItem();
  8. System.out.println(item);
  9. action(item.parent(), item, index.data());
  10. }
To copy to clipboard, switch view to plain text mode 

Everything works but if i add new item and after this i call editItem from QTreeWidget
and edit the content it seems that not every instructions in set data ara executed.
But if i edit existing item everything work as it suppose to work.
Are there any limitations for setModelData ? Why it behaves like this ?

Greets,
Kubas