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

Duane Hebert spoo at flarn.com
Wed Jun 23 15:05:01 CEST 2010


>"Ori Lahav" <vbcrlf at gmail.com> wrote in message >news:AANLkTilQ95HAdXUtmod7T6icybkK6XJAW9TY9xrJanmv at mail.gmail.com...
>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.



More information about the Qt-interest-old mailing list