[Development] New Qt example development guideline and revamping examples

Friedemann Kleint Friedemann.Kleint at qt.io
Thu Jan 19 14:44:16 CET 2023


we also need to agree on whether the Qt library rules apply to the full extent; for example:

- 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)
- Should tr() be used for all  user-facing messages (although examples mostly do not have translations set up)
- Do we use std::as_const to avoid detaching containers in loops (mostly missing for code ported from Q_FOREACH)

and probably some more?

Generally, when polishing examples, I found that member initialization greatly simplifies code.


More information about the Development mailing list