[PyQt] Graphic view

Nahuel Defossé nahueldefosse at yahoo.com.ar
Sun Jan 18 19:02:00 GMT 2009


El Saturday 17 January 2009 20:37:15 Frédéric escribió:

> I would like to implement this like Mark explains for tables, in its
> paper, "Qt 4's Model/View Delegates". As I'm new to Qt4, could you point
> me to the good direction? I'm a bit lost in all the classes available
> (QGraphicsScene/View/item...). Are there some example, somewhere?

Check the code attached. It's a basic QGraphicItem subclass which has it paint 
method overriden (check QPainter docs and QGraphicsItem.shape). It also 
listens to mouse events. If you want to do some changes when the item is hit 
by the mouse, you might want to call to update() after.

Nahuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.py
Type: application/x-python
Size: 2590 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090118/8012f765/main.bin


More information about the PyQt mailing list