[PySide] events for QStyledItemDelegate

Frank Rueter | OHUfx frank at ohufx.com
Mon Jun 25 05:47:25 CEST 2012

Hi all,

I'm just re-writing part of my existing code to use the mode/view approach.

I already have a complex custom widget which is a large button that can 
be dragged and dropped, and that shows "sub buttons" on mouse over (i.e. 
smaller rectangles are displayed in the corners on mouse over which act 
as buttons in the in own right).

The whole widget works exactly like I want it to, but now I'm wondering 
if it's possible to create a QStyledItemdelegate for the new model/view 
approach to do the same thing. It will need the same event handling as 
my custom widget, such as enterEvent, leaveEvent, mouseReleaseEvent, 
mousePressEvent, mouseReleaseEvent and mouseMoveEvent.

Is this possible with a delegate? Or can it be achieved in other ways?
Any pointers would be much appreciated.


More information about the PySide mailing list