On Mon, 17 Feb 2020 at 05:33, Max Paperno <ma...@wdg.us> wrote: > > Then found the [HEADS-UP: QStringLiteral][2] post by Marc on the > development list and didn't feel so good about it anymore. Specifically > where he says that using it with .arg() is an "anti-pattern" but not in > any way that I can understand (vs. just using QString). I went through > that whole meandering thread but didn't see string builder stuff brought > up again. >
I believe Marc was saying that using QStringLiteral *inside* a .arg() call is an anti-pattern, and not that using .arg() *on* a QStringLiteral is one. This match the documentation that states " QLatin1String can still be more efficient than QStringLiteral when the string is passed to a function that has an overload taking QLatin1String and this overload avoids conversion to QString." And the fact that QString::arg() does have an overload for QLatin1String. BR Benjamin
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest