[Development] HEADS UP: Don't use QList, use Q_DECLARE_TYPEINFO

Marc Mutz marc.mutz at kdab.com
Tue Jul 21 21:22:01 CEST 2015


On Tuesday 21 July 2015 19:11:42 Bubke Marco wrote:
> Thiago Macieira <thiago.macieira at intel.com>
> 
> > On Tuesday 21 July 2015 16:14:18 Bubke Marco wrote:
> > > Thiago Macieira <thiago.macieira at intel.com>
> > > 
> > > > > > Or like QString and QByteArray will be in Qt 6.
> > > > > 
> > > > > Are these still implicitly shared?
> > > > 
> > > > Yes, in large mode. In small string/array mode, they wouldn't share,
> > > > of course.
> > > 
> > > What about the conversion of std::vector to QVector and back. Do we get
> > > zero copy conversion?
> > 
> > Can't be done.
> 
> What about wrapping QVector around std::vector. In that case std::vector
> could be used in the internal implementation and application code.
> Interface would be still using QVector. Many developers I met who rejected
> Qt cited the argument what Qt is a closed island and not very operable
> with code which is using the standard library. What have made Qt
> productive 20 years ago is maybe not a good advice for the future.

Wether you use std::vector or QVector or QVarLengthArray doesn't really 
matter. What matters is that APIs are not formulated in terms of QVector or 
std::vector, but in terms of std::array_view.

-- 
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts



More information about the Development mailing list