kdelibs, KPopupMenu self-delete

Michael Buesch mbuesch at freenet.de
Thu May 19 17:29:46 BST 2005


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

> maybe connecting aboutToHide() to deleteLater() would help? 

That might work.
Thanks, I'll use this, if it works.

-- 
Greetings, Michael


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050519/bea2bcca/attachment.sig>


More information about the kde-core-devel mailing list