kdelibs, KPopupMenu self-delete

Hans Meine hans_meine at gmx.net
Thu May 19 17:22:14 BST 2005


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), maybe connecting aboutToHide() to deleteLater() would help?

Greetings,
  Hans




More information about the kde-core-devel mailing list