When using editorEvent in QItemDelegate, the QStyle::State_Selected doesn't arrive in the editorEvent but it does in paint. I'm using QStyleOptionViewItem.state.

Qt Code:
  1. bool InCallItemDelegate::editorEvent(QEvent * event, QAbstractItemModel * model
  2. , const QStyleOptionViewItem & option, const QModelIndex & index )
  3. {
  4. if((option.state & QStyle::State_Selected) == QStyle::State_Selected)
  5. {
  6. //This does not arrive.
  7. }
  8. }
  9.  
  10. void InCallItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
  11. {
  12. if((option.state & QStyle::State_Selected) == QStyle::State_Selected)
  13. {
  14. //This works
  15. }
  16. }
To copy to clipboard, switch view to plain text mode 

Should I capture the selection in some other way? Could be a QT bug? Im using 4.7.0


Thanks
Ramiro