Radhika
21st December 2015, 04:50
I have created Buttons dynamically.Now I want to create "click" event on them how can i do that ?
for(raw=1;raw<=20;raw++)
{
for(clm=1;clm<=5;clm++)
{
QPushButton *pb = new QPushButton();
pb->setIcon(hdd_img);
grid->addWidget(pb,raw,clm,1,1);
connect(pb, SIGNAL(clicked()), s_map, SLOT(map()));
}
}
I have tried this but it is not working
I want to show details of some object on that button click and want to access the ID of that button
for(raw=1;raw<=20;raw++)
{
for(clm=1;clm<=5;clm++)
{
QPushButton *pb = new QPushButton();
pb->setIcon(hdd_img);
grid->addWidget(pb,raw,clm,1,1);
connect(pb, SIGNAL(clicked()), s_map, SLOT(map()));
}
}
I have tried this but it is not working
I want to show details of some object on that button click and want to access the ID of that button