3.5. Multiple Inheritance
A few classes in Qt have more than one base class. In Java, multiple inheritance is possible
only with interfaces. To work around this limitation, Qt Jambi uses interfaces that wrap
the classes used in multiple inheritance contexts.
Consider the following C++ class definition:
class QWidget : public QObject, public QPaintDevice
{
...
};
The QWidget class inherits both QObject and QPaintDevice. In Qt Jambi, the class is defined
as follows:
public class QWidget extends QObject implements QPaintDeviceInterface
{
...
}
In this example, QPaintDeviceInterface is an interface that declares the same methods as
QPaintDevice without implementing them. Any member variable and method implementation
found in the original QPaintDevice class is put in QWidget instead. As a result, the Qt
Jambi version of QWidget has exactly the same API and functionality as the C++ version.
[^] # Re: héritage multiple?
Posté par golum . En réponse à la dépêche Trolltech publie les avancées de Qt pour Java. Évalué à 2.
http://www.trolltech.com/developer/downloads/qt/resolveuid/2(...)