[Development] RFC: Proposal for a semi-radical change in Qt APIs taking strings
André Somers
andre at familiesomers.nl
Wed Oct 14 16:30:14 CEST 2015
Op 14-10-2015 om 15:59 schreef Matthew Woehlke:
>
>>> Yes, signed please. We can discuss whether it should be 64bit for Qt 6.
>> The current std API uses size_t. Do you (= both of you) expect that ever to
>> change? If it doesn't, Qt will forever be the odd one out, until we finally
>> drop QVector etc for std::vector etc and then porting will be a horror because
>> of MSVC's annoying warnings.
> STL should change. In Qt and Python, you can use negative indices to
> refer to a distance (length) relative to the end (length) of the string.
> In STL you can't do that, which is a significant limitation by
> comparison. Please don't drop this useful functionality!
I'm not so sure anymore. Do you really think that for instance passing
in a negative _from_ in QString::indexOf to search from the back of the
string is intuitive API? I don't. I would rather have a specific
indexOfBackwards or something like that. Or one could just use the
iterator API with a standard algorithm I guess.
André
More information about the Development
mailing list