Hello Panupat,

I had a similar issue with my event filter and it turns out I needed to 
return the class event filter I was calling from:

return QtGui.QMainWindow.eventFilter(self, source, event)

Hope this helps!

Cheers, 

Ben

On Thursday, 7 May 2015 04:51:17 UTC-7, 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/3fc12706-5650-4351-ae43-67c9b39858ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to