....
connect(&t_buttons, SIGNAL(buttonClicked(int)), this, SLOT(AddBox(int)));
}
void CBox::AddBox(int i){
COBox = new COBox(i);
COBox->show();
}
....
t_buttons.addButton(new QPushButton("Box"), i);
connect(&t_buttons, SIGNAL(buttonClicked(int)), this, SLOT(AddBox(int)));
}
void CBox::AddBox(int i){
COBox = new COBox(i);
COBox->show();
}
To copy to clipboard, switch view to plain text mode
Here's how I did it. But whenever I click any of the buttons, so let's say I click on button 34, and it will pop up about 55 (the total amount of buttons) new Windows of COBox!!! Like as if it's stuck in a loop somehow. The constructor of COBox changes the Windowtitle to the number i, and seems like they're all the correct one, but one CLICK on ANY button creates 55 new windows... can't figure out why.
Bookmarks