[Development] QList
Andreas Aardal Hanssen
andreas.aardal.hanssen at gmail.com
Mon Mar 20 17:29:44 CET 2017
> 20. mar. 2017 kl. 17.14 skrev Mark Gaiser <markg85 at gmail.com>:
> On Sat, Mar 18, 2017 at 10:51 AM, Marc Mutz <marc.mutz at kdab.com <mailto:marc.mutz at kdab.com>> wrote:
>> 6. Kill QList or keep it as a deprecated class.
>> Thanks,
>> Marc
> Hi Marc,
> I'm fine with replacing QList usages with QVector in codebases i
> maintain, but even with the latest Qt version, that isn't always
> possible or convenient.
> For instance, at this very moment i want a QVector with all keys from
> a given map (QMap<QDate, QString>) but Qt itself doesn't provide a
> direct way of doing that.
I would probably use QDateTime(date).toMSecsSinceEpoch() or something similar as a key in such a map. It’s very hard to provide good default behavior for code that is inefficient at its core. In this case, QList and QVector would perform fairly similarly for both cases I /think/. Meaning for an integer key which is behaviourally equivalent but vastly more efficient, QList and QVector would store them the same way.
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170320/9ecf3672/attachment.html>
More information about the Development
mailing list