I’m getting this error with my eventFilter using PySide in Maya 2014.
# 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.
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"