-
Delete dialog
I hav an application in which i show a Dialog when a key_1 is pressed.Once i enter the mainwindow i do want to delete the dialog objects.Suggest a way in which i can do the
delete of the Dialog.I hav posted sample code
this is in the constructor of mainClass
connect(buttonBar->getButton(),SIGNAL,this,SLOT(showDialog())
showDialog of mainClass look like this
showDialog()
{
buttonBar->showDialog(this);
}
The buttonBar class showDialog looks like this
showDialog(mainClass mc)
{
myDilalog=new myDialog((QWidget *)mc,mc);
myDialog->show();
}
in the mainClass eventfilter i am giving the statement:
buttonBar->showDialog(this); for keypress
where can i delete the dialog.If i tried to delete in eventfilter its showing segmentation fault
-
Re: Delete dialog
Well, you could try deleting it when the main window is shown the first time ( by overriding showEvent).
Regards
-
Re: Delete dialog
Maybe it will be simplier if you set the Qt::WA_DeleteOnClose attribute for that dialog?
-
Re: Delete dialog
I tried using Qt::WA_DeleteOnClose...there is no change in my memory leak..