Hey there,

I've searched a bit on the forum,

I'm not sure how to update the model from its delegate edit event.

Qt Code:
  1. bool ZeChatRoom_delegate::editorEvent(QEvent *event,
  2. const QStyleOptionViewItem &option,
  3. const QModelIndex &index)
  4. {
  5. const ZeChatRoom_model* modelData = static_cast<const ZeChatRoom_model*>(index.model());
  6. ZeChatRoom_data * chatData = index.data().value<ZeChatRoom_data *>();
  7.  
  8. if (event->type() == QEvent::MouseButtonDblClick)
  9. {
  10. //QMouseEvent *mev = (QMouseEvent*)event;
  11.  
  12. modelData->getService().
  13. OpenChat(chatData->getRoomName() + '@' + modelData->getServer());
  14.  
  15. chatData->setClicked(true);
  16.  
  17. // Hey view could you update your display please ?
  18.  
  19. }
  20. else if (event->type() == QEvent::MouseButtonRelease)
  21. {
  22. chatData->setClicked(false);
  23.  
  24. // Hey view could you update your display please ?
  25. }
  26. return false;
  27. }
To copy to clipboard, switch view to plain text mode 

Thanks.