Re: [Interest] QByteArray vs QString, arg, why is there no arg()?

2019-09-18 Thread Thiago Macieira
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

Re: [Interest] QByteArray vs QString, arg, why is there no arg()?

2019-09-18 Thread Konstantin Tokarev
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()? >> >&

Re: [Interest] QByteArray vs QString, arg, why is there no arg()?

2019-09-18 Thread 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()? > > Il 18/09/19 13:16, Jason H ha scritto: > > What's the

Re: [Interest] QByteArray vs QString, arg, why is there no arg()?

2019-09-18 Thread Giuseppe D'Angelo via Interest
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

[Interest] QByteArray vs QString, arg, why is there no arg()?

2019-09-18 Thread Jason H
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