PDA

View Full Version : Qt non modal form how to



ras
5th August 2010, 19:20
Hi,

I declared my own progress dialog in the mainWindow class, as

ProgressDialog *pDialog;
and in the mainWindow constructor

pDialog = new ProgressDialog(this);
Then in a function mainWindow::foo, I used following, to show the dialog box as a non modal form,

pDialog->setRange(0, 100);
pDialog->setWindowFlags(Qt::CustomizeWindowHint | Qt::Dialog | Qt::WindowTitleHint);
pDialog->show();
I can only use it as non modal form, because I need to execute some more functions after showing (pDialog->show()) pDialog

After executing some function, I called

pDialog->hide();
to close the dialog window. On one pass (or a first call of mainWindow::foo), everything fine, and works as expected. But when I call the function again, it displays only the outlines (or a window only) of pDialog and it doesn't have any other widgets and buttons in the pDialog. Where is my mistake? How is the proper use of a non-modal dialog?

Thanking You,
Ras