| Umbrello UML Modeller: A Diagramming Programme for the Unified Modelling Language Developed Using Bazaar Methods; BSc Honuors Dissertation, Final Report; University of Stirling, Department of Computing Science and Mathematics; April 2003 | ||
|---|---|---|
| Prev | Chapter 3. Developing Umbrello UML Modeller | Next |
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.