Qt4 constructors

Guillaume Laurent glaurent at telegraph-road.org
Tue Sep 6 11:03:31 BST 2005


Benjamin Meyer wrote:

>I found http://doc.trolltech.com/4.0/qt4-intro.html, but doesn't go
>into much detail, and simply says: "This makes subclassing easier, at
>the same time as it helps make the Qt library more efficient."
>
>The vast majority of widgets don't need names which saves on memory,
>startup time, and binary size.
>  
>
I agree in principle, but in practice widgets still need to be named in 
some cases, so they still need to have a const char* name member. The 
only improvement I can see is that a widget construction will be a wee 
bit faster because that member will directly be initialized to 0 rather 
than set to a '0' which comes from an argument in the higher level of 
the construction. It does simplify the API though (and raise your hand 
if you've never built a QLabel with its content in its object name :-) ).

-- 
Guillaume
http://telegraph-road.org





More information about the kde-core-devel mailing list