[PyQt] connect and "TypeError: argument 1 of QObject.connect() has an invalid type"

Andreas Pakulat apaku at gmx.de
Tue Oct 20 09:09:58 BST 2009


On 20.10.09 10:06:13, Stefan Larsson wrote:
> You could also inherit QObject using multiple inheritance to add the
> capabilities of QObject as well...
> 
> class MyItem(QGraphicsView, QObject):

That doesn't work because QGraphicsView is already a QObject and inheriting
from multiple QObject-based classes is not supported by QObject.

I guess though you mean QGraphicsItem, in that case you need to inherit
from QObject first (I think this limitation of Qt/C++ is carried over to
PyQt) and then from QGraphicsItems. Or simply use the existing
QGraphicsWidget class.

Andreas

-- 
Don't plan any hasty moves.  You'll be evicted soon anyway.


More information about the PyQt mailing list