qt-interest@trolltech.com
[Top] [All Lists]

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

Subject: Re: [Qt-interest] Using a QList<float> as a float[] parameter
From: Thiago Macieira
Date: Wed, 23 Jun 2010 19:28:44 +0200
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@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest
<Prev in Thread] Current Thread [Next in Thread>