PDA

View Full Version : QVector assignment question



hvw59601
14th November 2007, 21:27
Hi,

In Qt3 I used QArray like this:


QArray<float> *t;
...
t = new QArray<float>(day_no+1);
...
t->at(j) = j+1;

and that worked. But in Qt4 you cannot do that. So I changed it:


QVector<float> t;
...
t[j] = j+1;

and that compiles OK but I want to do it like I did in Qt3 and allocate t as new:


t = new QVector<float>(day_no+1);

But how do I do the assignment then like line 3 in the middle chunk of the above?
Thanks!

jacek
14th November 2007, 21:34
(*t)[j] = j+1;