On Wednesday, 28 de September de 2011 02:49:45 [email protected] wrote: > > 2. Multiple inheritance > > > > Do we still need to have QDeclarativeParserStatus as a separate class? > > For QtQuick1 I understand that was necessary, since the base class was > > a QGraphicsItem; but for QtQuick2 the base class already inherits from > > QObject. So in order to avoid multiple inheritance, which generally > > it's a good thing, QSGItem could inherit from QSGObject (a new class) > > which could already provide virtual methods to handle the parsing > > phase. That would give us a flat hierarchical tree, providing all the > > benefits/optimizations of not using multiple inheritance. > > What are the "benefits" of not using multiple inheritance (of an interface)?
It only makes sense if you have or plan on having another class which also
inherits from this interface. Like QPaintDevice, which is implemented by
QWidget, QImage, QPixmap and QPrinter. If you only have one class, it
increases the virtual table size and code size, since the compiler needs to
emit thunk functions for no good reason.
Runtime impact should be minimal to negligible though, unless you start using
virtual inheritance.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
