QVector<double> attributes
Solved
General and Desktop
-
Hey qt people,
I have a little question to make multiple attributes in my .h
to create several objects of the same type I use this method:
//.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> private : std::vector<QLCDNumber*> lcd; //.cpp for (int i=0; i<22; i++) { lcd.push_back(new QLCDNumber(this)); }
for lcd (objects) it works perfectly. to make vectors of QVector<double> id in the .h and use them in the .cpp how to do ?
I have to create 90 of them and I would like to avoid writing in the .h :QVector<double> one_vector QVector<double> two_vector QVector<double> three_vector // // // QVector<double> xx_vector
if you have an idea, that's cool!
thanks all and take care of you :) -
-
@Albator
If the vectors are member variables they must be written in the .h.
Or you just don't want to write 90 times in .h?
Then how about an array of vectors, or a vector of vectors?QVector<double> vectors[90];
or
QVector<QVector<double>> vectors;