inefficient QString coding practice

Eva Brucherseifer eva at kde.org
Sat Mar 13 15:51:28 GMT 2004


On Saturday 13 March 2004 14:38, Thiago Macieira wrote:
> Dr. Juergen Pfennig wrote:
> >If we look into QT's source code, we find that QT would handle
> >
> >  if( extension == ".wav")
> >    ...
> >
> >much more efficient, because it has an overloaded == operator for
> > "const char*". Here is the source from qstring.cpp:
>
> Only if QT_NO_CAST_ASCII isn't given. If it is given, then all the
> implicit const char* to QString conversions are withheld.

Ther is no implicit cast involved. You have a member function available for 
exactly the parameters given. So no cast here and there shouldn't be any 
problem with the QT_NO_CAST_ASCII flag at all.

The questions is rather: Is this member function available in all supported Qt 
versions? If so it should be no problem to change all code to use the compare 
operator. 

Greetings,
eva




More information about the kde-core-devel mailing list