[Development] Wither QString?

Thiago Macieira thiago.macieira at intel.com
Fri Oct 18 05:01:36 CEST 2019


On Thursday, 17 October 2019 17:28:34 PDT Henry Skoglund wrote:
> std::string s = std::format("{0:b} {0:d} {0:x}", 42);   // s ==
> "101010 42 2a"|
> 
> Using QString::arg() works fine but it's getting harder to ignore all
> the new C++ stuff and C++20 looks to be one of the bigger additions to
> the language since C++11.

BTW, that doesn't mean we have to stick to QString::arg(). We had the 
beginnings of a change to implement format() like the fmt lib and like Python, 
but it hasn't been merged yet. That's a good thing because now we can look at 
what C++20 will have, including the very latest fixes to width and precision, 
and apply them correctly to Qt.

If we could use the Standard Library implementation, we would, but we can't 
depend on it until 2025 or thereabouts. We'll need to deploy our own.

https://github.com/fmtlib/fmt is MIT-licensed. If we can leverage the 
implementation, it's a path forward.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Development mailing list