[PyQt] How to Manage highlight on QGraphicsView

Matteo Boscolo matteo.boscolo at boscolini.eu
Wed Jun 9 16:30:56 BST 2010


Hi all,
I have done an implementation of a QGraphicsView that allows me to highlight
the QGraphicsItem.

Each QGraphicsItem overwrite the following method:

Class Circle(QtGui.QGraphicsItem):
..
    def hoverEnterEvent(self, event):
        self.setHiglight() #this set the highlight color
        self.update()
    
    def hoverLeaveEvent(self, event):
        self.setColor () #this set the standard color
        self.update()

If I create a line for example in 0,0,100,100 end I pass over with the mouse
pointer the entity is highlighted correctly.
But if I create a circle in 0,0 with radius 200 I'm not able to highlight
the line ..
It seems that the boundingRect of the circle overlap the line .. there is
any way to avoid this overlapping ?

Or other smart method to do the highlight of a QGraphicsItem..?

Regards,
Matteo









-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100609/4a756db7/attachment.html>


More information about the PyQt mailing list