Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<QPushButton*> lista;
- while(lista.size() < 10)
- {
- QPushButton* ptr = new QPushButton(this);
- ptr->setText(texto);
- // ...
- lista.push_back(ptr);
- }
- auto NewButton = [](QWidget* parent, QString texto)
- {
- QPushButton* ptr = new QPushButton(parent);
- ptr->setText(texto);
- return ptr;
- };
- std::vector<QPushButton*> lista;
- while(lista.size() < 10)
- {
- lista.push_back(NewButton(this,"prueba"));
- }
- for(i=0; i<10; i++)
- {
- QPushButton* ptr =new QPushButton(this);
- ptr->setText(texto);
- // ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement