hi ,
u can use QHash too.
i will use like this ,
int HOW_MANY_BUTTONS=200; //u can change this value dynamically as u wish;
for(int j=0; j<HOW_MANY_BUTTONS; j++)
{
btn[j]=b;
b->setGeometry(0,0,40,40);
ui->verticalLayout->addWidget(b,Qt::AlignVCenter);
}
QHash<int,QPushButton*> btn;
int HOW_MANY_BUTTONS=200; //u can change this value dynamically as u wish;
for(int j=0; j<HOW_MANY_BUTTONS; j++)
{
QPushButton *b=new QPushButton;
btn[j]=b;
b->setGeometry(0,0,40,40);
ui->verticalLayout->addWidget(b,Qt::AlignVCenter);
}
To copy to clipboard, switch view to plain text mode
hope it helps
Bala
Bookmarks