Re: [Development] format-like tr()

2024-10-24 Thread Mårten Nordheim via Development
Hello! I'm not sure {n} is great, it would clash with any potential name-matching. If we anyway keep the formatting specification in the string then it would make more sense to keep it in there. E.g. "{:#}" or something similar. If the translation moves the {...} into a different order they would

Re: [Development] format-like tr()

2024-10-24 Thread Ivan Solovev via Development
Hi Volker, > From my understanding, the idea behind the std::format framework would be > to have a “cardinality" type for which we can implement a special formatter, > allowing “whatever” to be in the format specification. True, but the custom formatter specialization is called when the argument

Re: [Development] format-like tr()

2024-10-24 Thread Thiago Macieira
On Thursday 24 October 2024 03:22:55 Pacific Daylight Time Ivan Solovev via Development wrote: > > Unfortunately, I think we'll need the entire parsing and constructing done > > from scratch. > > IMO, we could benefit from the new syntax, if we could build our > implementation on top of what the

Re: [Development] format-like tr()

2024-10-24 Thread Edward Welbourne via Development
Giuseppe D'Angelo (24 October 2024 18:54) wrote: > I'm actually thinking that we may be missing a use case: tr() can be > called with a string that does NOT contain %n. In this case, the > quantity parameter is only used to look up which plural form to > translate to; the developer can then use e.g

Re: [Development] Deprecated vs deprecated-to-be-removed APIs in Qt

2024-10-24 Thread Edward Welbourne via Development
Ivan Solovev (24 October 2024 16:32) wrote: > 3. New names > > While looking through the sources, I noticed that many of the APIs > simply got renamed. We have a lot of such cases for Qt 6.0, for > example in QFuture-related APIs. > > Another typical example here is the renaming of the error() sign

Re: [Development] format-like tr()

2024-10-24 Thread Thiago Macieira
On Thursday 24 October 2024 05:19:45 Pacific Daylight Time Giuseppe D'Angelo via Development wrote: > > Btw, where does the “tr” go? Is it going to be tr(std::format(…)) or > > std::vformat(tr(…))? > > > > In the former, we’d have to pass the value twice (once for std::format > > to substitute, o

Re: [Development] format-like tr()

2024-10-24 Thread Giuseppe D'Angelo via Development
Hi, Thanks for summarizing my very thoughts. Il 24/10/24 13:23, Volker Hilsheimer via Development ha scritto: Btw, where does the “tr” go? Is it going to be tr(std::format(…)) or std::vformat(tr(…))? In the former, we’d have to pass the value twice (once for std::format to substitute, once fo

Re: [Development] Deprecated vs deprecated-to-be-removed APIs in Qt

2024-10-24 Thread Nicolas Fella via Development
Am 24.10.24 um 16:32 schrieb Ivan Solovev via Development: Hi, following up on the Deprecation vs Compatibility discussion from the Qt Contributor Summit [0], I implemented a macro that allows to mark the APIs as deprecated and to-be-removed in the Next Major Release [1]. [0]:https://wiki.qt.io

Re: [Development] format-like tr()

2024-10-24 Thread Thiago Macieira
On Thursday 24 October 2024 10:12:35 Pacific Daylight Time Thiago Macieira wrote: > > IMO, we could benefit from the new syntax, if we could build our > > implementation on top of what the standard provides for us. But I see > > little benefit in reimplementing the standard from scratch. > > I'm

Re: [Development] format-like tr()

2024-10-24 Thread Ivan Solovev via Development
> Unfortunately, I think we'll need the entire parsing and constructing done > from scratch. To be honest, I'm not a big fan of this idea. We already have a working code that does the translation, and we also have QString::arg() formatting. IMO, we could benefit from the new syntax, if we could b

Re: [Development] format-like tr()

2024-10-24 Thread Thiago Macieira
On Thursday 24 October 2024 04:11:13 Pacific Daylight Time Mårten Nordheim via Development wrote: > (When I was still poking at QStringFormatter I was doing named arguments, > but implemented as a templated struct you could pass in as a 'special' > argument. e.g., QStringFormatter("{a:L}").arg(QSt

Re: [Development] format-like tr()

2024-10-24 Thread Volker Hilsheimer via Development
> On 24 Oct 2024, at 12:29, Ivan Solovev wrote: > > Hi Volker, > >> From my understanding, the idea behind the std::format framework would be >> to have a “cardinality" type for which we can implement a special formatter, >> allowing “whatever” to be in the format specification. > > True, but t

Re: [Development] Flakey tests heatmap analysis

2024-10-24 Thread Tor Arne Vestbø via Development
Hello, > On Oct 24, 2024, at 03:15, EXT Mitch Curtis wrote: > > Hi, > > Once I've gotten into a specific filter (i.e. > https://testresults.qt.io/grafana/d/de08wetl3yq68f/Test%20failure%20heatmaps?var-integration=149569&var-table_name=blacklisted_tests&var-project=qt%2Fqtdeclarative&var-config

Re: [Development] format-like tr()

2024-10-24 Thread Volker Hilsheimer via Development
> On 23 Oct 2024, at 22:55, Thiago Macieira wrote: >>> a) keep the "n" and make it mandatory, as in {n} >> >> If we use std::format, then we cannot do it, because it does the >> argument index parsing on its own, and delegates to a custom formatter >> specialization after that. And argument index