PDA

View Full Version : QItemDelegate::editorEvent



jml
13th February 2008, 00:12
I'm trying to do custom editing in a table via a sub-class of QItemDelegate. But the editorEvent method does not seem to work. If i set the focus policy of the view to Qt::StrongFocus, it captures mouse click events, but it still doesn't capture key events such as Tab, etc. I know I can use QObject::eventFilter, but that's a lot less convenient because it doesn't provide access to the model. Is there some way to have editorEvent capture key press events?

jml
13th February 2008, 00:26
It just occurred to me after posting this question that maybe the problem is that the editor provided by the delegate gets created on a focus in event and destroyed on a focus out event. Maybe I need to look focus events at the view level rather than at the delegate level.