[Development] Introducing discussion about QStringFormatter

Shawn Rutledge Shawn.Rutledge at qt.io
Tue May 16 16:15:55 CEST 2017


> On 15 May 2017, at 15:16, Marc Mutz <marc.mutz at kdab.com> wrote:
> 
> 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.

We’ve been writing QDebug operator<<(QDebug debug, const QType &o) a lot.  I wish we could rather write something which generates a string, for each Qt type, and then reuse it for debug operators, for string concatenation, for formatting like this, and also make sure that console.log() in QML uses it.  Same pattern as toString() in Java, but maybe in C++ an operator makes more sense, as long as it’s not clumsy to use.



More information about the Development mailing list