[Development] New Qt example development guideline and revamping examples

Thiago Macieira thiago.macieira at intel.com
Thu Jan 19 16:15:18 CET 2023


On Thursday, 19 January 2023 05:44:16 PST Friedemann Kleint via Development 
wrote:
> - Do we use the modern string literals (u"bla"_s, previously, example code
> just constructed QString from ASCII and did not care about
> -DQT_NO_CAST_FROM_ASCII, IIRC)

I don't mind using modern string literals, but don't set 
QT_NO_CAST_FROM_ASCII. That means non u"" strings are fine.

Separate problem: we have to figure out a way that u"bla" without _s also 
works. It HAS to work.

> - Should tr() be used for all  user-facing messages (although examples
> mostly do not have translations set up)

Would be good, yes.

> - Do we use std::as_const to avoid detaching containers in loops (mostly
> missing for code ported from Q_FOREACH)

Yes, that's good practice.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5167 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230119/5427f4bf/attachment-0001.bin>


More information about the Development mailing list