@wysota, Lykurg. If any of you come to Belgrade please call I owe you guys at least a beer for all the help you provided me. I don't think that I would done half the work I did with out the help from you guys. There is already a message box in all my programs which pops out when you click about. Among general information about the program there is a sentence. This program was made possible by the TrollTech team from Nokia which created the ingenious Qt framework, and generous help by the Qt developers on www.qtcentre.org.
Now back to my problem. I will read documentation on QStackedWidget. To try to better explain myself.
I started to explain better to you what I am trying to do. I wrote a long message and thinking about the problem while I was writing I solved it. I know how to do it.
But just to be clear on one thing let say I have code like this
{
//somecode
MyWidget1 *widget1;
MyWidget2 *widget2;
}
//someplace in code in MainWindow implementation
widget1 = new MyWidget1(this);
setCentralWidget(widget1);
//some other place in code in MainWindow implementation
if(condition)
{
widget2 = new MyWidget(this);
setCentralWidget(widget2);
}
MainWindow : public QMainWindow
{
//somecode
MyWidget1 *widget1;
MyWidget2 *widget2;
}
//someplace in code in MainWindow implementation
widget1 = new MyWidget1(this);
setCentralWidget(widget1);
//some other place in code in MainWindow implementation
if(condition)
{
widget2 = new MyWidget(this);
setCentralWidget(widget2);
}
To copy to clipboard, switch view to plain text mode
Will this cause memory leak if I just leave it like this? Can I delete widget1 after I set widget2 as central or will deleting widget1 cause problems.
Thanks in advance for helping me improve.
Bookmarks