On Wednesday, 18 September 2019 06:57:11 PDT Jason H wrote:
> I do prefer python's approach where the character size change does not come
> with an API change. Maybe discussion for Qt6?. I would think they C++ way
> would be to have 1 API and a template class? (Though I think some people
> cringe a
18.09.2019, 16:59, "Jason H" :
>> Sent: Wednesday, September 18, 2019 at 2:50 PM
>> From: "Giuseppe D'Angelo via Interest"
>> To: interest@qt-project.org
>> Subject: Re: [Interest] QByteArray vs QString, arg, why is there no arg()?
>>
> Sent: Wednesday, September 18, 2019 at 2:50 PM
> From: "Giuseppe D'Angelo via Interest"
> To: interest@qt-project.org
> Subject: Re: [Interest] QByteArray vs QString, arg, why is there no arg()?
>
> Il 18/09/19 13:16, Jason H ha scritto:
> > What&
Il 18/09/19 13:16, Jason H ha scritto:
What's the best way to zero-pad a QByteArray?
What I want is QByteArray("%1").arg(6, 10, 10, '0')
Mostly it has to do with the fact that QByteArray is sitting between two
worlds; on one side it's just a container of bytes, on the other side it
has _some_
Shiver me timbers! I often find myself using QString::arg() overloads for
formatting, but nothing like that exists for when I'm working with just bytes,
say for a socket or serial port. So I find myself constructing it as a QString
and then .toLocal8bit() , which just seems wasteful.
What's th