NoatunStdAction
Prev
Next

NoatunStdAction

NoatunStdAction is great for creating menus and toolbar buttons. Each item in the namespace returns a KAction*, and is allocated by new inside, so if you give it no parent, you'll have to delete the KAction yourself.

The following example creates a popup menu, adds a Play button to it, and shows the menu at the cursor's current location.

KPopupMenu menu;
NoatunStdAction::play(&menu)->plug(&menu);
menu.exec(QCursor::pos());

This handles the icons and the states of the icons by itself.

Prev
Next
Home