how to set save variables into a QList iterating it?
- 
Wanting to save variables through a for but those variables bring the same name and those are identified at a number, how to save those variables in a for loop? and after it change their value by reference. example: QLabel variable_1, variable_2, variable_3; QList<QLabel> list; for (int i = 1 ; i == 3; ++i) { list.append(variable_i); } for (int i = 1 ; i == 3; ++i) { *list->setText("VALUE "); }Maybe there are a better way to do this because it bring an error when execute the code. Thanks 
- 
@ripley said in how to set save variables into a QList iterating it?: QList<QLabel> First this won't work - you can save a pointer to an object in a container but not the object itself. 
 Second - you want a vector, not a listStoring them in a loop is possible but I don't think it's really needed for three elements for (QLabel *l : {variable_1, variable_2, variable_3}) list.push_back(l);
 

