I don't think he's ever installing the filter, that would explain why it isn't complaining about anything.
On 10 November 2014 07:39, Justin Israel <[email protected]> wrote: > You seem to have only made a partial change from my other suggestion. I > had suggested using event.ChildRemove, yet you have kept that extra .Type. > bit in there. Isn't that giving you an error about not existing? > > > On Mon Nov 10 2014 at 8:34:20 PM Marcus Ottosson <[email protected]> > wrote: > >> Is that the full code? I can't see where you're installing the filter. >> Don't forget to run installEventFilter() on the target object. >> >> Have a look at this example. >> https://gist.github.com/mottosso/ce114dfe4a264b52e235 >> >> On 10 November 2014 07:29, Arvid Schneider <[email protected]> >> wrote: >> >>> Thanks for all the help! >>> But dont get an error now. But its still not working. >>> >>> >>> class HyperShadeEventFilter(QtCore.QObject): >>> def __init__(self): >>> super(HyperShadeEventFilter, self).__init__() >>> ptr = mui.MQtUtil.mainWindow() >>> mainWin = shiboken.wrapInstance(long(ptr), QtGui.QWidget) >>> mainWin.installEventFilter(self) >>> >>> def eventFilter(self, object, event): >>> print event.type() >>> if event.type() == event.Type.ChildPolished: >>> child = event.child() >>> print child.objectName() >>> if 'hyperShadePanel' in child.objectName(): >>> print 'OPEN' >>> elif event.type() == event.Type.ChildRemoved: >>> child = event.child() >>> if 'hyperShadePanel' in child.objectName(): >>> print 'CLOSE' >>> HyperShadeEventFilter() >>> >>> -- >>> 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/45b59ddf-16ce-4434-a356-0d1179bb6114%40googlegroups.com >>> <https://groups.google.com/d/msgid/python_inside_maya/45b59ddf-16ce-4434-a356-0d1179bb6114%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> *Marcus Ottosson* >> [email protected] >> >> -- >> 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/CAFRtmODwawJi0dKjmBa%3DqGnwgffbzTs9MPXX1MO9g1pQAPNodA%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODwawJi0dKjmBa%3DqGnwgffbzTs9MPXX1MO9g1pQAPNodA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > 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/CAPGFgA3jG3-d%2BOGv8aoNFwTGv3UwZZFg4%2Byx2J2bR0da1aYs5A%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3jG3-d%2BOGv8aoNFwTGv3UwZZFg4%2Byx2J2bR0da1aYs5A%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- 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/CAFRtmOA2yk%2Bskjn-6wQmiSsr%3Dd5OJ%2BNGUCUd8KawtwBYhPfKzA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
