Either one of method the slot/method will allocate memory on heap then how do I suppose to delete it in the destructor?
Test::~Test()
{
delete frame;
delete frame_2;
delete ui;
}
void Test::on_pushButton_clicked()
{
frame = new QFrame();
frame->show();
}
void Test::on_pushButton_2_clicked()
{
frame_2 = new QFrame();
frame_2->show();
}
Actually I want to build a app that has multiple buttons, each button allocates different QFrame. Or my coding design for situation like this is wrong?
Thank you.