On quarta-feira, 11 de abril de 2012 12.12.23, [email protected] wrote: > I was never a really big fan of adding lots of virtual_hook()'s to > classes. vtable entries do come at a cost and in many cases it's not > really required. I am certainly against blindly adding them to all our > classes.
In KDE 3, we added virtual_hook() everywhere.
In KDE 4, we removed from all classes deriving from QObject. qt_metacall is
our virtual hook.
For non-QObject classes which *already* have virtual tables, we should
consider it. Fortunately, those classes are minority in Qt, we have very few
of them.
And by consider, I don't mean "definitely use". Take QEvent, for example: it's
virtual, but it has barely any virtual functions. It's unlikely we'll need a
virtual_hook in it.
(In fact, QEvent is really bad: it's a copyable polymorphic class)
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
