[PyKDE] QWidgetFactory.create installEventFilter
Hi, I'm using pyqt 3.7 with Qt 3.1.2. I try to create dynamically a Dialog out of a ui file and install an eventHandler afterwards. class EventMgr(QObject): def __init__(self): pass def eventFilter(self, object, event): if (event.type() == QEvent.Close): print QEvent.Close def OtherFunc: myEventMgr = EventMgr() myDialog = qtui.QWidgetFactory.create(sFile + .ui) myDialog.installEventFilter(myEventMgr) If I try to run the programm I get the error AttributError sipThis in the line of installEventFilter. Can someone give me an hint? Andrew ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] QWidgetFactory.create installEventFilter
On Friday 22 August 2003 10:22 am, Andrew Smart wrote: Hi, I'm using pyqt 3.7 with Qt 3.1.2. I try to create dynamically a Dialog out of a ui file and install an eventHandler afterwards. class EventMgr(QObject): def __init__(self): pass def eventFilter(self, object, event): if (event.type() == QEvent.Close): print QEvent.Close def OtherFunc: myEventMgr = EventMgr() myDialog = qtui.QWidgetFactory.create(sFile + .ui) myDialog.installEventFilter(myEventMgr) If I try to run the programm I get the error AttributError sipThis in the line of installEventFilter. Can someone give me an hint? You forgot to call QObject.__init__() from EventMgr.__init__(). Phil ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
RE: [PyKDE] QWidgetFactory.create installEventFilter
Phil Thompson wrote: On Friday 22 August 2003 10:22 am, Andrew Smart wrote: Hi, I'm using pyqt 3.7 with Qt 3.1.2. I try to create dynamically a Dialog out of a ui file and install an eventHandler afterwards. class EventMgr(QObject): def __init__(self): pass def eventFilter(self, object, event): if (event.type() == QEvent.Close): print QEvent.Close def OtherFunc: myEventMgr = EventMgr() myDialog = qtui.QWidgetFactory.create(sFile + .ui) myDialog.installEventFilter(myEventMgr) If I try to run the programm I get the error AttributError sipThis in the line of installEventFilter. Can someone give me an hint? You forgot to call QObject.__init__() from EventMgr.__init__(). Shame on me. I blame.. ehhh... myself! Thanx! Andrew ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde