From kde-commits Tue May 29 14:22:34 2007 From: David Faure Date: Tue, 29 May 2007 14:22:34 +0000 To: kde-commits Subject: Re: KDE/kdepim/libkdepim Message-Id: <200705291622.38193.dfaure () klaralvdalens-datakonsult ! se> X-MARC-Message: https://marc.info/?l=kde-commits&m=118044864831531 On Tuesday 29 May 2007, Laurent Montel wrote: > On mardi 29 mai 2007, David Faure wrote: > > On Tuesday 29 May 2007, Laurent Montel wrote: > > > +void KMeditor::Private::slotFindDialogDestroyed() > > >  { > > > +  //Be sure to delete it later. > > > +  findDialog->deleteLater(); > > > +  findDialog = 0L; > > >  } > > > > findDialog->setAttribute(Qt::WA_DeleteOnClose) does the same without the > > need for a slot. > > Are you sure that findDialog pointer is put to "null" ? > I try to look at into qt source and didn't see that pointer value was put to > null. Ah, no, you are right. Delete on close is good for "create and forget" objects, not for the case where you have a pointer that should be set to 0 to remember that the dialog was deleted. Well, there's QPointer for that, but together with the delete-on-close flag that might be a bit too much magic to people's taste :) Do as you prefer. -- David Faure, faure@kde.org, dfaure@klaralvdalens-datakonsult.se KDE/KOffice developer, Qt consultancy projects Klarälvdalens Datakonsult AB, Platform-independent software solutions