[Development] RFC: Proposal for a semi-radical change in Qt APIs taking strings

Thiago Macieira thiago.macieira at intel.com
Wed Oct 14 20:32:06 CEST 2015


On Wednesday 14 October 2015 20:09:56 Marc Mutz wrote:
> On Wednesday 14 October 2015 12:41:12 Allan Sandfeld Jensen wrote:
> > Why not a QCharArray? With external data constructor, that should be the
> > same,  shouldn't it?
> 
> If you propose something like QString/QByteArray::fromRawData(), then that 
> allocates the control block, so no, not really an option.

Which is also solved by the null d-pointer.

In other words
	QStringLiteral("foo") === QString::fromRawData(u"foo", 3);

In theory. In practice, there may be some dragons hidden somewhere.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list