QMenu -> PUD
Jeff Mitchell
mitchell at kde.org
Fri Oct 30 03:19:46 CET 2009
Hey,
A much requested feature is done as of 24a39b4: you can now create a PUD
directly from a QMenu. Here's how. One caveat: right now, it can't
create more than two levels, so if you have a submenu in a submenu, it
won't work. If this is actually a problem for us (AFAIK it isn't) I'll
look at this sooner rather than later.
QMenu *myMenu;
PopupDropper *pud = The::popupDropperFactory::createPopupDropper( this );
pud->addMenu( myMenu );
The::popupDropperFactory::adjustItems( pud );
That's it! Seriously -- that's it. You can get rid of all the other
stuff now. :-)
One other thing -- addMenu *adds* items, so you can mix and match
QMenu-added items and items added to the PUD another way.
--Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20091029/ce67cd6e/attachment.sig
More information about the Amarok-devel
mailing list