oh and i'm sorry. The script in pastebin missing the event.accept() line, but still, the eventFilter is not working :(
On Fri, Apr 19, 2013 at 2:35 PM, Tuan Nguyen <[email protected]> wrote: > yes, i try it too, the print statement. But nothing is print out, so i > guess its not working? > > > > On Fri, Apr 19, 2013 at 1:52 PM, Justin Israel <[email protected]>wrote: > >> Did you confirm that the eventFilter() is being called? Put a print >> statement right after: >> if obj is self.GraphicsView >> >> Also remember to do event.accept() if you are handling the event >> yourself so that it doesn't bubble up. >> >> >> >> On Fri, Apr 19, 2013 at 6:36 PM, Tuan Nguyen <[email protected]>wrote: >> >>> Sorry to dig this up, at that time, i were using the first way you told >>> me, it works fine so i think i will left it like that for a while and come >>> back after had finished other part. But somehow, i think the eventFilter is >>> not working at all, >>> >>> >>> self.GraphicsView.mousePressEvent = self.qView_mousePressEvent >>> >>> def eventFilter(self, obj, event): >>> if obj is self.GraphicsView: >>> if event.button() != QtCore.Qt.LeftButton: >>> self.qView_mousePressEvent(event) >>> return True >>> >>> in the mousePressEvent i had a case when event.button() == >>> QtCore.Qt.LeftButton, it will return the QGraphicsView,mousePressEvent. And >>> if i remove it, the leftMousePressEvent is gone too >>> >>> I also try install the eventFilter on GraphicsView but no luck :( >>> >>> http://pastebin.com/SbJfsHTG >>> >>> >>> On Fri, Mar 1, 2013 at 3:01 AM, Tuan Nguyen <[email protected]>wrote: >>> >>>> Maybe i had done something funny when reimplement mouseEvent, so the >>>> result after calling class out still wrong. I will check the script again, >>>> also thank for show me how to use eventFilter. I try to go with it at first >>>> place, but since time is short, i chose replace the bounding method instead >>>> :D >>>> >>>> Thank for your reply, Justin >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Python Programming for Autodesk Maya" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected] >>> . >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Python Programming for Autodesk Maya" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/python_inside_maya/rUzeXlRweDI/unsubscribe?hl=en-US >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> >> To post to this group, send email to [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
