[PySide] events for QStyledItemDelegate

Frank Rueter | OHUfx frank at ohufx.com
Mon Jul 2 07:20:40 CEST 2012


Does anybody have an idea how to do this?
This seems to be turning into a show stopper for me.
I found this thread but since it's C++ I have a hard time deciphering it:
http://www.qtcentre.org/threads/8660-Drawing-a-widget-in-QItemDelegate-s-paint-method

I don't need to edit the item data, just need to represent it with a 
custom widget (showing various buttons inside the widget on mouse over) 
and make it drag&dropable.

I've attached a screen grab of what my working custom widget looks like 
(with and without mouse over). I hope it comes through ok.
I *just* need to be able to use this as a delegate somehow.


Cheers,
frank




On 25/06/12 3:47 PM, Frank Rueter | OHUfx wrote:
> 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 their 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.
>
> Cheers,
> frank
>
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2012-07-02 at 5.15.55 PM.png
Type: image/png
Size: 30888 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20120702/1f397835/attachment.png>


More information about the PySide mailing list