22.3.2.  Multiple Inheritance with QObject

[ fromfile: multiple-inheritance.xml id: multinheritance-qobject ]

Figure 22.3.  QGraphicsObject and Multiple Inheritance

QGraphicsObject and Multiple Inheritance

[Note]Note

In Figure 22.3, QObject is one of the base classes that is multiply inherited. One restriction Qt has is that QObject must be inherited only once by any class (virtual inheritance is not supported). Furthermore, the QObject-derived base must be listed first in the list of base classes. Breaking this rule can lead to strange errors from the code generated by the MetaObject compiler (moc).