If you're capturing events in your custom class and implementing eventFilter, I think you have to return true/false as the event handling side of things is expecting to be told whether or not to continue bubbling the event, or if it's to be stopped at that point. Since you're not returning in your function, that'd be the error message (expecting bool, got None)
(see https://srinikom.github.io/pyside-docs/PySide/QtCore/QObject.html#PySide.QtCore.PySide.QtCore.QObject.eventFilter ) On Thu, May 7, 2015, at 09:51 PM, Panupat Chongstitwattana wrote: > I'm getting this error with my eventFilter using PySide in Maya 2014. > > Code: > # RuntimeWarning: Invalid return value in function > # QMainWindow.eventFilter, expected bool, got NoneType., at line 3, in > # "C:\Program Files\Autodesk\Maya2014\bin\maya.exe" # RuntimeWarning: Invalid return value in function # QMainWindow.eventFilter, expected bool, got NoneType., at line 1, # in "sys" > It doesn't show up every time... only sometimes. The line number also > doesn't relate the line of codes I have. > > Am I doing something wrong? I'm subclassing QMainwindow and also a ui I converted using pysideuic. Here is my part of the code. > > > Code: class MyClass(QtGui.QMainWindow, my_converted_ui): def __init__(self, *args, **kwargs): super(MyClass, self).__init__(*args, **kwargs) self.setupUi(self) self.installEventFilter(self) def eventFilter(self, object, event): if event.type() == QtCore.QEvent.WindowActivate: print "widget window has gained focus" > > -- > 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 view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f86b9c33-c6bb-4d5a-8c93-107c81ea1833%40googlegroups.com[1]. > For more options, visit https://groups.google.com/d/optout. Links: 1. https://groups.google.com/d/msgid/python_inside_maya/f86b9c33-c6bb-4d5a-8c93-107c81ea1833%40googlegroups.com?utm_medium=email&utm_source=footer -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1431000084.232749.263921809.247D5E7F%40webmail.messagingengine.com. For more options, visit https://groups.google.com/d/optout.
