Andre Poenitz schreef:
On Sun, Apr 12, 2009 at 12:01:24PM +0200, Vincent van Ravesteijn wrote:
+ rc += bgColor.name();
+ return rc;
+ }
+ return QLatin1String("");
return QString()
if you are at it ;-)
Andre'
Well, I asked Uwe about this and he answered that he got it from Qt
(designer), and Qt will probably be right :)
return QString();
It might be that the orgininal code was coming from a place where the
string literal might be not empty and possibly even translatable, but
in the current context QString() is uniformly better (line-noise wise,
generated code-wise and performance-wise)
Andre'
If you are at it, could you then also explain when we should use
QLatin1String.
A few lines above, there is the line QString rc =
QLatin1String("background:") ? Does this have an added value or should
we just use QString rc("background:") ?
Vincent