[Development] HEADS UP: Don't use QList, use Q_DECLARE_TYPEINFO
Konrad Rosenbaum
konrad at silmor.de
Sat Jul 11 16:43:49 CEST 2015
On Friday 10 July 2015 17:01:04 Smith Martin wrote:
> And apparently QVector has the same API as QList now, so why don't we
> deprecate QList. Let it always create a QVector.
Do you mean deprecate for use inside Qt? Maybe in Qt 6 or 7.
In general? For user code as well? HELL NO! (sorry for the shouting...)
Thiago listed a few exceptions under which the use of lists is legitimate.
These situations exist - more frequently than some of you seem to believe.
At least in code that was not written under ideal circumstances (which in my
sad little corner of industry is about 99.5% of all code).
Believe it or not - I've got plenty of code in which I frequently and
dynamically change the size of lists of complex objects. Doing this with
QVector would create its own kind of re-allocation hell. And no, for most of
these instances it's impossible to predict how large the list will be before
it is complete - it often depends on data that first needs to be parsed,
analysed, requested, or otherwise pulled piecewise out of some remote
process' tight grasp.
If Qt deprecated QList I would have to convert a lot of legacy code to
std::list; neither QVector (allocation hell) nor QLinkedList (slow retrieval
with large data sets) are serious alternatives.
Konrad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150711/e6bee38f/attachment.sig>
More information about the Development
mailing list