Hello,

I have this QMainWindow form and this QDialog form that is sort of child of QMainWindow one. So when a button is cliecked in the mainWidget I want the dialog to appear. I do it like:

as global variable define dialog's instance:

Qt Code:
  1. dialog *dialogWindow;
To copy to clipboard, switch view to plain text mode 

then I initialize the instance and show it:
Qt Code:
  1. void mainWindow::showDialog()
  2. {
  3. dialogWindow=new dialog(this);
  4. dialog->show();
  5. }
To copy to clipboard, switch view to plain text mode 

And it shows. But if I make changes in the dialog's interface (say, put a value in a lineedit that appears in the dialog), and close the dialog, and then call/show it again from the mainWindow, I don't get new dialog instance, but the very same one, with the last values I've put in it. I tried to do setAttribute(Qt::WA_DeleteOnClose); but it doesn't work.

Any idea?