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: "Duane Hebert"
Date: Wed, 23 Jun 2010 09:05:01 -0400
>"Ori Lahav" <vbcrlf@xxxxxxxxx> wrote in message 
>>news:AANLkTilQ95HAdXUtmod7T6icybkK6XJAW9TY9xrJanmv@xxxxxxxxxxxxxxxxx
>Hi Srdjan,
>This function is in an external library, can't change it.

You can change your list of floats to std::vector<float> and then pass it by 
ref as

std::vector<float> Floats;
//fill it

pass it as &Floats[0]

std::vector is guaranteed to be contiguous so this should be safe.
_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>