3.9. Use of Multiple Inheritance

Umbrello makes only one use of multiple inheritance, a practice usually condemned by software engineers. UMLWidget inherits both from QCanvasRectangle which draws the widget on the canvas to be displayed to the user, and QObject which is the base class of most of Qt's classes.

The purpose of this dual inheritance is not to implement the functionality of both classes but to allow for the language extensions used by Qt but only allowed in classes derived from QObject. UMLWidget makes use of Qt's extensions for mouse and other events. It seems strange that QCanvasRectangle is not derived from QObject, it is one of the few classes in the library not to. Presumably this is for optimisation reasons.