[Qt-interest] Using a QList<float> as a float[] parameter

Ori Lahav vbcrlf at gmail.com
Wed Jun 23 21:03:19 CEST 2010


Thanks Thiago, I didn't know that. I'll read about the containers in the QT
documentation.

On Wed, Jun 23, 2010 at 8:28 PM, Thiago Macieira <thiago at kde.org> wrote:

> On Wednesday 23 June 2010 14:01:42 Ori Lahav wrote:
> > Hello QTers,
> >
> > I want to use a function that requests float* (array of float) as a
> > parameter. The problem is, the data in my program is stored in a linked
> > list of float. The only possible solution I could think of is copy the
> > whole list to a new array, but it is very expansive (my program uses this
> > function a lot).
> > Is there any other solution?
>
> The answer to your question was already given (QVector), but I'd like to
> point
> out one discrepancy in your email.
>
> Your subject talks about QList<float>, but the body of your email talks
> about a
> linked list.
>
> QList is not a linked list -- QLinkedList is a linked list and std::list is
> a
> linked list.
>
> QList is technically a pointer array, with a special optimisation to store
> the
> type in the pointer value if it fits and is movable.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>  Senior Product Manager - Nokia, Qt Development Frameworks
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100623/4a5ff5c6/attachment.html 


More information about the Qt-interest-old mailing list