[ fromfile: multiple-inheritance.xml id: multinheritance-qobject ]
Many classes in Qt use multiple inheritance. Figure 22.3 shows the inheritance relationship between classes used in QGraphicsView. QGraphicsItem is a lightweight object, which does not support signals or slots. QGraphicsObject inherits from QObject first, and QGraphicsItem second, and can offer the best of both worlds: a QGraphicsObject that supports signals and slots, typically used in animation. QWidget, shown earlier in Figure 22.1 is another class that uses multiple inheritance from QObject.
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 ( |
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |