gemidjy
28th February 2008, 16:42
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:
dialog *dialogWindow;
then I initialize the instance and show it:
void mainWindow::showDialog()
{
dialogWindow=new dialog(this);
dialog->show();
}
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?
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:
dialog *dialogWindow;
then I initialize the instance and show it:
void mainWindow::showDialog()
{
dialogWindow=new dialog(this);
dialog->show();
}
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?