I would like to pass an object to another form after a event, in this case a pressed button I can not use QSignalMapper because it is not an int, string or a widget. Signals and slots are for me the only solution, but I do not know how to pass the vTest[i] variable.
std::vector<Test * > vTest;
... fill vTest ...
for(int i = 0; i < vTest.size(); i++)
{
QPushButton * pButton = new QPushButton(vTest[i]->getTestName());
connect(pButton,SIGNAL(clicked(bool)),this,SLOT(slotGoNextPage(???)));
}
here is the call of the function slot slotGoNextPage
void slotGoNextPage(){
goNextPage(); }
...
void goNextPage(){
pForm->var = ?? // value which comes from vTest[i]
stackedWidget_page->setCurrentIndex(1);
}
And what should I do to pass more than one parameter?