PDA

View Full Version : How to open a new form



icarus1
13th February 2012, 10:25
Hi there,

I am really new in Qt programming and this forum also.

So I would like to salute all of you.


I am wotking on my first project and I am trying to show an existing form.

My command has like this


void MainWindow::on_actionAbout_triggered()
{
about a;
a.show();
}


When thin function is executed the a window is shown for some miliseconds and then it disapears. It seem like it is not activated anymore.

Why this happen ?


Thank you

Lykurg
13th February 2012, 11:00
Use exec() to show it as a modal dialog.. And why it is currently deleted (basic C++): you create "about" on the stack and thus it gets deleted after the scope "}" ends.

icarus1
13th February 2012, 11:09
Thank you.