kdelibs, KPopupMenu self-delete

David Faure faure at kde.org
Thu May 19 17:39:53 BST 2005


On Thursday 19 May 2005 18:29, Michael Buesch wrote:
> Quoting Hans Meine <hans_meine at gmx.net>:
> > On Thursday 19 May 2005 17:23, Michael Buesch wrote:
> > > void Foo::showContextMenu_slot(/*...*/)
> > > {
> > >  KPopupMenu *menu = new KPopupMenu(this);
> > >  menu->setDeleteOnHide(true);
> > >  // menu->insertItem(......
> > >  menu->popup(pos);
> > >  // no need to care about deleting the context menu.
> > > }
> > >
> > > Is there a way to do this, which is already provided by QT/KDE?
> > If WDestructiveClose does not work for popups (I guess you'd have used that 
> > otherwise),
> 
> I think hide != close

In general yes, but not for a popup.

Are you sure that WDestructiveClose doesn't work?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list