[Development] QStringLiteral vs QLatin1String , foreach vs for range

Knoll Lars Lars.Knoll at theqtcompany.com
Wed Jan 20 11:17:02 CET 2016


On 20/01/16 11:58, "Development on behalf of Marc Mutz" <development-bounces at qt-project.org on behalf of marc.mutz at kdab.com> wrote:

>On Wednesday 20 January 2016 08:19:04 Thiago Macieira wrote:
>> On Wednesday 20 January 2016 08:12:58 André Somers wrote:
>> > Where is this qAsConst coming from? When was it introduced? Where is it
>> > documented?
>> 
>> Commit 264c72837d6ff717a248dd180c2dfb45391c6aab, in dev. No api docs.
>
>It was intended as private API for use within Qt. If the sentiment is that it 
>should be public, I'll add proper docs.
>
>If the sentiment is also that we should start to discourage the use of 
>Q_FOREACH, then I'll add a \note to its docs pointing at qAsConst + range-for.

+1 to both. Let's encourage people to use range-for and qAsConst instead of foreach.

Cheers,
Lars



More information about the Development mailing list