[Qt-interest] Using a QList<float> as a float[] parameter
Thiago Macieira
thiago at kde.org
Wed Jun 23 19:28:44 CEST 2010
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100623/2f61d678/attachment.bin
More information about the Qt-interest-old
mailing list