Qt4 constructors

Benjamin Meyer icefox at gmail.com
Tue Sep 6 11:26:59 BST 2005


yes, setObjectName() is a lot nicer in that regard.  Reading the code
you know exactly what it is doing rather then questioning if it is the
caption, text or object name.

-Benjamin Meyer

On 9/6/05, Guillaume Laurent <glaurent at telegraph-road.org> wrote:
> 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