[PyQt] inheriting from QObject and dbus.service.Object

Marcos Dione mdione at grulic.org.ar
Tue Aug 11 06:54:35 BST 2009


    I'm trying to export some class' methods via DBus. this class is already a 
subclass of QObject, so I thought that simply adding inheritance on 
dbus.service.Object would work. but it doesn't; I get this error:

In [2]: import dbus.service

In [5]: from PyQt4.QtCore import QObject

In [8]: class A (dbus.service.Object, QObject): pass
TypeError: Error when calling the metaclass bases
    metaclass conflict: the metaclass of a derived class must be a (non-strict) 
    subclass of the metaclasses of all its bases

    I tried figuring out which are the metaclasses. it was easy for 
dbus.service.Object, but no cigar with QObject:


In [4]: dbus.service.Object.__metaclass__
Out[4]: <class 'dbus.service.InterfaceType'>

In [6]: QObject.__metaclass__
AttributeError: type object 'QObject' has no attribute '__metaclass__'

    is it possible to inherit from both? or will I have to make another class 
for this?

-- 
(Not so) Random fortune:
To make a thief, make an owner; to create crime, create laws.
	    -- Ursula K. Le Guin, "The dispossessed"


More information about the PyQt mailing list