Hi,

I have a custom delegate where I need to handle the mouse enter and leave events.

This is the code:
Qt Code:
  1. bool labelDelegate::editorEvent(QEvent *event, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)
  2. {
  3. qDebug() << "In editorEvent";
  4. if (event->type() == QEvent::Enter)
  5. {
  6. qDebug() << "Enter";
  7. QCursor cursor(Qt::PointingHandCursor);
  8. QApplication::setOverrideCursor(cursor);
  9. return true;
  10. }
  11. if (event->type() == QEvent::Leave)
  12. {
  13. qDebug() << "Leave";
  14. QCursor cursor(Qt::ArrowCursor);
  15. QApplication::setOverrideCursor(cursor);
  16. return true;
  17. }
  18. return false;
  19. }
To copy to clipboard, switch view to plain text mode 

But the editorEvent does not get any mousemove,enter or leave, only mousepress and mouserelease

Any idea how to do this?

Thanks,
Carlos.