[Development] Introducing discussion about QStringFormatter
Marc Mutz
marc.mutz at kdab.com
Mon May 15 15:16:10 CEST 2017
On Monday 15 May 2017 14:49:19 MÃ¥rten Nordheim wrote:
> 1. Why do we [not] want QStringFormatter in the library?
con: already have enough formatters in Qt, better work on those than
introducing something else _again_.
pro: have too many formatters in Qt, add one that can encompass and replace
all of them
> 2. If QStringFormatter gets implemented, what are its hard requirements?
To reach the 'pro' above, imo these are essential:
Strictly More Featureful - Every formatting that can be implemented with the
existing tools, QStringFormatter must support too.
Not Less Performant - For every formatting that can be implemented with the
existing tools, QStringFormatter's version must not be slower.
> 3. What are its soft requirements?
Not Less Concise - For every formatting that can be implemented with the
existing tools, QStringFormatter's version must not be (much more) verbose.
Open For Extension - Users can add formatting for their own types (like
QStringBuilder allows, but using documented API). QDateTime, etc support to
be added as examples.
Compile-Time Checks - Like asprintf (on GCC) and QStringBuilder, the
correctness is checked at compile-time (unlike arg()).
Blend In - It should interoperate with the existing formatters until such a
day as it replaces them.
Thanks,
Marc
--
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
More information about the Development
mailing list