|
Enumerations |
| enum | StdAction { , TipofDay
} |
Functions |
| KAction * | create (StdAction id, const char *name, const QObject *recvr, const char *slot, KActionCollection *parent) |
| KAction * | action (StdAction act_enum, const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0L) |
| const char * | name (StdAction id) |
|
const char * | stdName (StdAction act_enum) |
| | @obsolete. Use name
|
| QStringList | stdNames () |
| KAction * | openNew (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | open (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KRecentFilesAction * | openRecent (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | save (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | saveAs (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | revert (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | close (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | print (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | printPreview (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | mail (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | quit (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | undo (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | redo (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | cut (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | copy (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | paste (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | selectAll (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | deselect (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | find (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | findNext (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | findPrev (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | replace (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | actualSize (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | fitToPage (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | fitToWidth (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | fitToHeight (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | zoomIn (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | zoomOut (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | zoom (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | redisplay (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | up (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | back (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | forward (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | home (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | prior (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | next (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | goTo (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | gotoPage (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | gotoLine (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | firstPage (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | lastPage (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | addBookmark (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | editBookmarks (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | spelling (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KToggleAction * | showMenubar (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KToggleAction * | showToolbar (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KToggleToolBarAction * | showToolbar (const char *toolBarName, KActionCollection *parent, const char *name=0) |
| KToggleAction * | showStatusbar (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | saveOptions (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | keyBindings (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | preferences (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | configureToolbars (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | configureNotifications (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | help (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | helpContents (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | whatsThis (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | tipOfDay (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | reportBug (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | aboutApp (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
| KAction * | aboutKDE (const QObject *recvr, const char *slot, KActionCollection *parent, const char *name=0) |
These actions should be used instead of hardcoding menubar and toolbar items. Using these actions helps your application easily conform to the KDE UI Style Guide
In general, using standard actions should be a drop in replacement for regular actions. For example, if you previously had:
It is possible to use the standard actions in various non-recommended ways. Say, for instance, you wanted to have a standard action (with the associated correct text and icon and accelerator, etc) but you didn't want it to go in the standard place (this is not recommended, by the way). One way to do this is to simply not use the XML UI framework and plug it into wherever you want. If you do want to use the XML UI framework (good!), then it is still possible.
Basically, the XML building code matches names in the XML code with the internal names of the actions. You can find out the internal names of each of the standard actions by using the stdName action like so: KStdAction::stdName(KStdAction::Cut) would return 'edit_cut'. The XML building code will match 'edit_cut' to the attribute in the global XML file and place your action there.
However, you can change the internal name. In this example, just do something like:
Now, in your local XML resource file (e.g., yourappui.rc), simply put 'my_cut' where you want it to go.
Another non-standard usage concerns getting a pointer to an existing action if, say, you want to enable or disable the action. You could do it the recommended way and just grab a pointer when you instantiate it as in the the 'openNew' example above... or you could do it the hard way:
Another non-standard usage concerns instantiating the action in the first place. Usually, you would use the member functions as shown above (e.g., KStdAction::cut(this, SLOT, parent)). You may, however, do this using the enums provided. This author can't think of a reason why you would want to, but, hey, if you do, here's how: