I have a QGraphicsItem in a QGraphicsView as part of a MainWindow. I'd like to have a the QGraphicsItem have custom behaviour for a tab key press. However, the MainWindow seems to intercept the tab key and use it to move to the next widget after the QGraphicsView in the window.

There is a workaround for this to allow QWidgets to have tab key behaviour:

http://doc.trolltech.com/4.2/eventsandfilters.html

But this doesn't seem to work as QGraphicsItems don't naturally derive event behaviour from either QObject or QWidget.

I've also tried calling event->accept() in MyGraphicsWidget::keyPressEvent(), but it doesn't seem to get a chance to even accept it (for example, if ( event->key() == Qt::Key_Tab ) qDebug( "tab" ) produces no output ).

Is there a way to have custom tabkey behaviour for QGraphicsItems?

Thanks in advance, Neil.