Re: [PyKDE] QObject.inherits and queryList (still broken in 4.2?)
Hello, a few days ago I posted a bugreport about the QObject.inherits() not working as expected with SIP/PyQT: http://www.mail-archive.com/pykde@mats.imk.fraunhofer.de/msg04211.html This seems fixed with SIP 4.2 and PyQT 3.14, but sadly queryList() still appears to be broken. from qt import * app = QApplication([]) w = QWidget() class Foo(QWidget): ... pass ... f = Foo(w) f.className() 'Foo' f.isA(Foo) True f.inherits(Foo) True w.queryList() [__main__.Foo object at 0x00813690] w.queryList(QWidget) [__main__.Foo object at 0x00813690] w.queryList(Foo) [] So, any clue about this? It will be fixed in the next PyQt snapshot. Phil ___ PyKDE mailing listPyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] QObject.inherits and queryList (still broken in 4.2?)
Hello, a few days ago I posted a bugreport about the QObject.inherits() not working as expected with SIP/PyQT: http://www.mail-archive.com/pykde@mats.imk.fraunhofer.de/msg04211.html This seems fixed with SIP 4.2 and PyQT 3.14, but sadly queryList() still appears to be broken. from qt import * app = QApplication([]) w = QWidget() class Foo(QWidget): ... pass ... f = Foo(w) f.className() 'Foo' f.isA(Foo) True f.inherits(Foo) True w.queryList() [__main__.Foo object at 0x00813690] w.queryList(QWidget) [__main__.Foo object at 0x00813690] w.queryList(Foo) [] So, any clue about this? -- Giovanni Bajo ___ PyKDE mailing listPyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] QObject.inherits?
Torsten Marek [EMAIL PROTECTED] wrote: This came up some days ago, I think Phil fixed it in the snapshots. And he said that he'll release sip 4.2/PyQt 3.14 in a couple of days, so you'll need some patience - or build the snapshot yourself. OK, I'll build RC2 for now. Thanks -- Giovanni Bajo ___ PyKDE mailing listPyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] QObject.inherits?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Giovanni Bajo schrieb: | Hello, | | I see this behaviour with PyQt: | | |from qt import * |a = QApplication([]) |class Foo(QObject): | | ... pass | ... | |f = Foo() |print f.className() | | Foo | |print f.isA(Foo) | | False | |print f.inherits(Foo) | | False | | | I found out this while trying to use QObject.queryList, which does not work | as expected for Python objects. One has to do: | | [x for x in self.queryList() if isinstance(x, Foo)] | | instead of: | | self.queryList(Foo) | | which is a tad more readable and easy. This came up some days ago, I think Phil fixed it in the snapshots. And he said that he'll release sip 4.2/PyQt 3.14 in a couple of days, so you'll need some patience - or build the snapshot yourself. greetings Torsten - -- Torsten Marek [EMAIL PROTECTED] ID: A244C858 -- FP: 1902 0002 5DFC 856B F146 894C 7CC5 451E A244 C858 Keyserver: subkeys.pgp.net -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCEPjBfMVFHqJEyFgRApziAJ9OBeUGh3+I1NMN2oKkRghqjhgrywCfd1cL pZVaUZeu37YmtMS6FrM2ypg= =8niz -END PGP SIGNATURE- ___ PyKDE mailing listPyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[PyKDE] QObject.inherits() don't work as expected
Hi Phil, shouldn't attached script return True both times? Doc says: A class is considered to inherit itself. Cheers, Pete #! /usr/bin/env python # 2005-02-04initial versionhp import sys from qt import * class Test(QWidget): def __init__(self, *args): QWidget.__init__(self, *args) if __name__ == '__main__': app = QApplication(sys.argv) w = Test(None) print inherit QWidget:, w.inherits(QWidget) print inherit Test:, w.inherits(Test) w.show() QObject.connect(qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit())) app.exec_loop() ___ PyKDE mailing listPyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] QObject.inherits() don't work as expected
On Sunday 06 February 2005 7:16 pm, Hans-Peter Jansen wrote: Hi Phil, shouldn't attached script return True both times? Doc says: A class is considered to inherit itself. I'll take a look. BTW, the I haven't yet got around to looking at the other things you've raised - but I haven't forgotten them. Phil ___ PyKDE mailing listPyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
Re: [PyKDE] QObject.inherits() don't work as expected
Hans-Peter Jansen schrieb: Hi Phil, shouldn't attached script return True both times? Doc says: A class is considered to inherit itself. But isn't QObject::inherits based on the Qt metaobject techniques? Unless there was some hand-written code for this function, this code will not work (unless I underestimate the deep dark magic sip does, and I most certainly do). However, the attached code behaves the same way, too. greetings Torsten -- Torsten Marek [EMAIL PROTECTED] ID: A244C858 -- FP: 1902 0002 5DFC 856B F146 894C 7CC5 451E A244 C858 Keyserver: subkeys.pgp.net qobject.inherits.py Description: application/python signature.asc Description: PGP signature signature.asc Description: OpenPGP digital signature ___ PyKDE mailing listPyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde