KStandardAction

KStandardAction Namespace Reference

Enumerations

enum  StandardAction {
  ActionNone, New, Open, OpenRecent,
  Save, SaveAs, Revert, Close,
  Print, PrintPreview, Mail, Quit,
  Undo, Redo, Cut, Copy,
  Paste, SelectAll, Deselect, Find,
  FindNext, FindPrev, Replace, ActualSize,
  FitToPage, FitToWidth, FitToHeight, ZoomIn,
  ZoomOut, Zoom, Redisplay, Up,
  Back, Forward, Home, Prior,
  Next, Goto, GotoPage, GotoLine,
  FirstPage, LastPage, DocumentBack, DocumentForward,
  AddBookmark, EditBookmarks, Spelling, ShowMenubar,
  ShowToolbar, ShowStatusbar, SaveOptions, KeyBindings,
  Preferences, ConfigureToolbars, Help, HelpContents,
  WhatsThis, ReportBug, AboutApp, AboutKDE,
  TipofDay, ConfigureNotifications, FullScreen, Clear,
  PasteText, SwitchApplicationLanguage, DeleteFile, RenameFile,
  MoveToTrash, Donate, HamburgerMenu
}
 

Functions

QAction_k_createInternal (StandardAction id, QObject *parent)
 
QActionaboutApp (const QObject *recvr, const char *slot, QObject *parent)
 
QActionaboutApp (const QObject *recvr, Func slot, QObject *parent)
 
QActionaboutKDE (const QObject *recvr, const char *slot, QObject *parent)
 
QActionaboutKDE (const QObject *recvr, Func slot, QObject *parent)
 
QList< StandardActionactionIds ()
 
QActionactualSize (const QObject *recvr, const char *slot, QObject *parent)
 
QActionactualSize (const QObject *recvr, Func slot, QObject *parent)
 
QActionaddBookmark (const QObject *recvr, const char *slot, QObject *parent)
 
QActionaddBookmark (const QObject *recvr, Func slot, QObject *parent)
 
QActionback (const QObject *recvr, const char *slot, QObject *parent)
 
QActionback (const QObject *recvr, Func slot, QObject *parent)
 
static QActionbuildAutomaticAction (QObject *parent, StandardAction id, const char *slot)
 
QActionclear (const QObject *recvr, const char *slot, QObject *parent)
 
QActionclear (const QObject *recvr, Func slot, QObject *parent)
 
QActionclear (QObject *parent)
 
QActionclose (const QObject *recvr, const char *slot, QObject *parent)
 
QActionclose (const QObject *recvr, Func slot, QObject *parent)
 
QActionconfigureNotifications (const QObject *recvr, const char *slot, QObject *parent)
 
QActionconfigureNotifications (const QObject *recvr, Func slot, QObject *parent)
 
QActionconfigureToolbars (const QObject *recvr, const char *slot, QObject *parent)
 
QActionconfigureToolbars (const QObject *recvr, Func slot, QObject *parent)
 
QActioncopy (const QObject *recvr, const char *slot, QObject *parent)
 
QActioncopy (const QObject *recvr, Func slot, QObject *parent)
 
QActioncopy (QObject *parent)
 
QActioncreate (StandardAction id, const QObject *recvr, Func slot, QObject *parent)
 
QActioncreate (StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
 
QActioncut (const QObject *recvr, const char *slot, QObject *parent)
 
QActioncut (const QObject *recvr, Func slot, QObject *parent)
 
QActioncut (QObject *parent)
 
QActiondeleteFile (const QObject *recvr, const char *slot, QObject *parent)
 
QActiondeleteFile (const QObject *recvr, Func slot, QObject *parent)
 
QActiondeselect (const QObject *recvr, const char *slot, QObject *parent)
 
QActiondeselect (const QObject *recvr, Func slot, QObject *parent)
 
QActiondocumentBack (const QObject *recvr, const char *slot, QObject *parent)
 
QActiondocumentBack (const QObject *recvr, Func slot, QObject *parent)
 
QActiondocumentForward (const QObject *recvr, const char *slot, QObject *parent)
 
QActiondocumentForward (const QObject *recvr, Func slot, QObject *parent)
 
QActiondonate (const QObject *recvr, const char *slot, QObject *parent)
 
QActiondonate (const QObject *recvr, Func slot, QObject *parent)
 
QActioneditBookmarks (const QObject *recvr, const char *slot, QObject *parent)
 
QActioneditBookmarks (const QObject *recvr, Func slot, QObject *parent)
 
QActionfind (const QObject *recvr, const char *slot, QObject *parent)
 
QActionfind (const QObject *recvr, Func slot, QObject *parent)
 
QActionfindNext (const QObject *recvr, const char *slot, QObject *parent)
 
QActionfindNext (const QObject *recvr, Func slot, QObject *parent)
 
QActionfindPrev (const QObject *recvr, const char *slot, QObject *parent)
 
QActionfindPrev (const QObject *recvr, Func slot, QObject *parent)
 
QActionfirstPage (const QObject *recvr, const char *slot, QObject *parent)
 
QActionfirstPage (const QObject *recvr, Func slot, QObject *parent)
 
QActionfitToHeight (const QObject *recvr, const char *slot, QObject *parent)
 
QActionfitToHeight (const QObject *recvr, Func slot, QObject *parent)
 
QActionfitToPage (const QObject *recvr, const char *slot, QObject *parent)
 
QActionfitToPage (const QObject *recvr, Func slot, QObject *parent)
 
QActionfitToWidth (const QObject *recvr, const char *slot, QObject *parent)
 
QActionfitToWidth (const QObject *recvr, Func slot, QObject *parent)
 
QActionforward (const QObject *recvr, const char *slot, QObject *parent)
 
QActionforward (const QObject *recvr, Func slot, QObject *parent)
 
KToggleFullScreenActionfullScreen (const QObject *recvr, const char *slot, QWidget *window, QObject *parent)
 
KToggleFullScreenActionfullScreen (const QObject *recvr, Func slot, QWidget *window, QObject *parent)
 
QActiongoTo (const QObject *recvr, const char *slot, QObject *parent)
 
QActiongoTo (const QObject *recvr, Func slot, QObject *parent)
 
QActiongotoLine (const QObject *recvr, const char *slot, QObject *parent)
 
QActiongotoLine (const QObject *recvr, Func slot, QObject *parent)
 
QActiongotoPage (const QObject *recvr, const char *slot, QObject *parent)
 
QActiongotoPage (const QObject *recvr, Func slot, QObject *parent)
 
KHamburgerMenuhamburgerMenu (const QObject *recvr, const char *slot, QObject *parent)
 
QActionhamburgerMenu (const QObject *recvr, Func slot, QObject *parent)
 
QActionhelp (const QObject *recvr, const char *slot, QObject *parent)
 
QActionhelp (const QObject *recvr, Func slot, QObject *parent)
 
QActionhelpContents (const QObject *recvr, const char *slot, QObject *parent)
 
QActionhelpContents (const QObject *recvr, Func slot, QObject *parent)
 
QActionhome (const QObject *recvr, const char *slot, QObject *parent)
 
QActionhome (const QObject *recvr, Func slot, QObject *parent)
 
QActionkeyBindings (const QObject *recvr, const char *slot, QObject *parent)
 
QActionkeyBindings (const QObject *recvr, Func slot, QObject *parent)
 
QActionlastPage (const QObject *recvr, const char *slot, QObject *parent)
 
QActionlastPage (const QObject *recvr, Func slot, QObject *parent)
 
QActionmail (const QObject *recvr, const char *slot, QObject *parent)
 
QActionmail (const QObject *recvr, Func slot, QObject *parent)
 
QActionmoveToTrash (const QObject *recvr, const char *slot, QObject *parent)
 
QActionmoveToTrash (const QObject *recvr, Func slot, QObject *parent)
 
const char * name (StandardAction id)
 
QActionnext (const QObject *recvr, const char *slot, QObject *parent)
 
QActionnext (const QObject *recvr, Func slot, QObject *parent)
 
QActionopen (const QObject *recvr, Func slot, QObject *parent)
 
QActionopen (const QObject *recvr, const char *slot, QObject *parent)
 
QActionopenNew (const QObject *recvr, Func slot, QObject *parent)
 
QActionopenNew (const QObject *recvr, const char *slot, QObject *parent)
 
KRecentFilesActionopenRecent (const QObject *recvr, Func slot, QObject *parent)
 
KRecentFilesActionopenRecent (const QObject *recvr, const char *slot, QObject *parent)
 
QActionpaste (const QObject *recvr, const char *slot, QObject *parent)
 
QActionpaste (const QObject *recvr, Func slot, QObject *parent)
 
QActionpaste (QObject *parent)
 
QActionpasteText (const QObject *recvr, const char *slot, QObject *parent)
 
QActionpasteText (const QObject *recvr, Func slot, QObject *parent)
 
QActionpreferences (const QObject *recvr, const char *slot, QObject *parent)
 
QActionpreferences (const QObject *recvr, Func slot, QObject *parent)
 
QActionprint (const QObject *recvr, const char *slot, QObject *parent)
 
QActionprint (const QObject *recvr, Func slot, QObject *parent)
 
QActionprintPreview (const QObject *recvr, const char *slot, QObject *parent)
 
QActionprintPreview (const QObject *recvr, Func slot, QObject *parent)
 
QActionprior (const QObject *recvr, const char *slot, QObject *parent)
 
QActionprior (const QObject *recvr, Func slot, QObject *parent)
 
QActionquit (const QObject *recvr, const char *slot, QObject *parent)
 
QActionquit (const QObject *recvr, Func slot, QObject *parent)
 
QActionredisplay (const QObject *recvr, const char *slot, QObject *parent)
 
QActionredisplay (const QObject *recvr, Func slot, QObject *parent)
 
QActionredo (const QObject *recvr, const char *slot, QObject *parent)
 
QActionredo (const QObject *recvr, Func slot, QObject *parent)
 
QActionrenameFile (const QObject *recvr, const char *slot, QObject *parent)
 
QActionrenameFile (const QObject *recvr, Func slot, QObject *parent)
 
QActionreplace (const QObject *recvr, const char *slot, QObject *parent)
 
QActionreplace (const QObject *recvr, Func slot, QObject *parent)
 
QActionreportBug (const QObject *recvr, const char *slot, QObject *parent)
 
QActionreportBug (const QObject *recvr, Func slot, QObject *parent)
 
QActionrevert (const QObject *recvr, const char *slot, QObject *parent)
 
QActionrevert (const QObject *recvr, Func slot, QObject *parent)
 
QActionsave (const QObject *recvr, const char *slot, QObject *parent)
 
QActionsave (const QObject *recvr, Func slot, QObject *parent)
 
QActionsaveAs (const QObject *recvr, const char *slot, QObject *parent)
 
QActionsaveAs (const QObject *recvr, Func slot, QObject *parent)
 
QActionsaveOptions (const QObject *recvr, const char *slot, QObject *parent)
 
QActionsaveOptions (const QObject *recvr, Func slot, QObject *parent)
 
QActionselectAll (const QObject *recvr, const char *slot, QObject *parent)
 
QActionselectAll (const QObject *recvr, Func slot, QObject *parent)
 
QActionselectAll (QObject *parent)
 
KStandardShortcut::StandardShortcut shortcutForActionId (StandardAction id)
 
KToggleActionshowMenubar (const QObject *recvr, const char *slot, QObject *parent)
 
KToggleActionshowMenubar (const QObject *recvr, Func slot, QObject *parent)
 
KToggleActionshowStatusbar (const QObject *recvr, const char *slot, QObject *parent)
 
KToggleActionshowStatusbar (const QObject *recvr, Func slot, QObject *parent)
 
QActionspelling (const QObject *recvr, const char *slot, QObject *parent)
 
QActionspelling (const QObject *recvr, Func slot, QObject *parent)
 
const char * stdName (StandardAction act_enum)
 
QStringList stdNames ()
 
QActionswitchApplicationLanguage (const QObject *recvr, const char *slot, QObject *parent)
 
QActionswitchApplicationLanguage (const QObject *recvr, Func slot, QObject *parent)
 
QActiontipOfDay (const QObject *recvr, const char *slot, QObject *parent)
 
QActiontipOfDay (const QObject *recvr, Func slot, QObject *parent)
 
QActionundo (const QObject *recvr, const char *slot, QObject *parent)
 
QActionundo (const QObject *recvr, Func slot, QObject *parent)
 
QActionup (const QObject *recvr, const char *slot, QObject *parent)
 
QActionup (const QObject *recvr, Func slot, QObject *parent)
 
QActionwhatsThis (const QObject *recvr, const char *slot, QObject *parent)
 
QActionwhatsThis (const QObject *recvr, Func slot, QObject *parent)
 
QActionzoom (const QObject *recvr, const char *slot, QObject *parent)
 
QActionzoom (const QObject *recvr, Func slot, QObject *parent)
 
QActionzoomIn (const QObject *recvr, const char *slot, QObject *parent)
 
QActionzoomIn (const QObject *recvr, Func slot, QObject *parent)
 
QActionzoomOut (const QObject *recvr, const char *slot, QObject *parent)
 
QActionzoomOut (const QObject *recvr, Func slot, QObject *parent)
 

Detailed Description

Convenience methods to access all standard KDE actions.

These actions should be used instead of hardcoding menubar and toolbar items. Using these actions helps your application easily conform to the KDE Human Interface Guidelines.

See also
https://hig.kde.org/

All of the documentation for QAction holds for KStandardAction also. When in doubt on how things work, check the QAction documentation first. Please note that calling any of these methods automatically adds the action to the actionCollection() of the QObject given by the 'parent' parameter.

Simple Example:
In general, using standard actions should be a drop in replacement for regular actions. For example, if you previously had:

QAction *newAct = new QAction(i18n("&New"),
QIcon::fromTheme("document-new"),
this,
&ClassFoo::fileNew,
actionCollection());

You can replace it with:

QAction *newAct = KStandardAction::openNew(this, &ClassFoo::fileNew, actionCollection());

Non-standard Usages
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 name method like so: KStandardAction::name(KStandardAction::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:

(void)KStandardAction::cut(this, SLOT(editCut()), actionCollection(), "my_cut");

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 'openNew' example above... or you could do it the hard way:

QAction *cut = actionCollection()->action(KStandardAction::name(KStandardAction::Cut));

Another non-standard usage concerns instantiating the action in the first place. Usually, you would use the member functions as shown above (e.g., KStandardAction::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:

(void)KStandardAction::action(KStandardAction::New, this, SLOT(fileNew()), actionCollection());
(void)KStandardAction::action(KStandardAction::Cut, this, SLOT(editCut()), actionCollection());
Author
Kurt Granroth granr[email protected][email protected][email protected]kde.o[email protected]rg

Enumeration Type Documentation

The standard menubar and toolbar actions.

Enumerator
New 

Create a new document or window.

Open 

Open an existing file.

OpenRecent 

Open a recently used document.

Save 

Save the current document.

SaveAs 

Save the current document under a different name.

Revert 

Revert the current document to the last saved version.

Close 

Close the current document.

Print 

Print the current document.

PrintPreview 

Show a print preview of the current document.

Mail 

Send the current document by mail.

Quit 

Quit the program.

Undo 

Undo the last operation.

Redo 

Redo the last operation.

Cut 

Cut selected area and store it in the clipboard.

Copy 

Copy selected area and store it in the clipboard.

Paste 

Paste the contents of clipboard at the current mouse or cursor.

SelectAll 

Select all elements in the current document.

Deselect 

Deselect any selected elements in the current document.

Find 

Initiate a 'find' request in the current document.

FindNext 

Find the next instance of a stored 'find'.

FindPrev 

Find a previous instance of a stored 'find'.

Replace 

Find and replace matches.

ActualSize 

View the document at its actual size.

FitToPage 

Fit the document view to the size of the current window.

FitToWidth 

Fit the document view to the width of the current window.

FitToHeight 

Fit the document view to the height of the current window.

ZoomIn 

Zoom in the current document.

ZoomOut 

Zoom out the current document.

Zoom 

Select the current zoom level.

Redisplay 

Redisplay or redraw the document.

Up 

Move up (web style menu).

Back 

Move back (web style menu).

Forward 

Move forward (web style menu).

Home 

Go to the "Home" position or document.

Prior 

Scroll up one page.

Next 

Scroll down one page.

Goto 

Jump to some specific location in the document.

GotoPage 

Go to a specific page.

GotoLine 

Go to a specific line.

FirstPage 

Jump to the first page.

LastPage 

Jump to the last page.

DocumentBack 

Move back (document style menu).

DocumentForward 

Move forward (document style menu).

AddBookmark 

Add the current page to the bookmarks tree.

EditBookmarks 

Edit the application bookmarks.

Spelling 

Pop up the spell checker.

ShowMenubar 

Show/Hide the menubar.

ShowToolbar 

Show/Hide the toolbar.

ShowStatusbar 

Show/Hide the statusbar.

SaveOptions 
Deprecated:
Since 5.38, no known users.
KeyBindings 

Display the configure key bindings dialog.

Preferences 

Display the preferences/options dialog.

ConfigureToolbars 

Display the toolbar configuration dialog.

Help 
Deprecated:
Since 5.38, use HelpContents instead.
HelpContents 

Display the handbook of the application.

WhatsThis 

Trigger the What's This cursor.

ReportBug 

Open up the Report Bug dialog.

AboutApp 

Display the application's About box.

AboutKDE 

Display the About KDE dialog.

TipofDay 

Display the "Tip of the Day".

ConfigureNotifications 

Display the notifications configuration dialog.

FullScreen 

Switch to/from full screen mode.

Clear 

Clear the content of the focus widget.

PasteText 
Deprecated:
Since 5.39, use Paste instead.
SwitchApplicationLanguage 

Display the Switch Application Language dialog.

DeleteFile 

Permanently deletes files or folders.

Since
5.25
RenameFile 

Renames files or folders.

Since
5.25
MoveToTrash 

Moves files or folders to the trash.

Since
5.25
Donate 

Open donation page on kde.org.

Since
5.26
HamburgerMenu 

Opens a menu that substitutes the menubar.

Since
5.81

Definition at line 119 of file kstandardaction.h.

Function Documentation

QAction * KStandardAction::_k_createInternal ( StandardAction  id,
QObject parent 
)

Definition at line 121 of file kstandardaction.cpp.

QAction * KStandardAction::aboutApp ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display the application's About box.

Definition at line 716 of file kstandardaction.cpp.

QAction* KStandardAction::aboutApp ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display the application's About box.

Since
5.23
QAction * KStandardAction::aboutKDE ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display the About KDE dialog.

Definition at line 721 of file kstandardaction.cpp.

QAction* KStandardAction::aboutKDE ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display the About KDE dialog.

Since
5.23
QList< StandardAction > KStandardAction::actionIds ( )

Returns a list of all actionIds.

Since
4.2

Definition at line 40 of file kstandardaction.cpp.

QAction * KStandardAction::actualSize ( const QObject recvr,
const char *  slot,
QObject parent 
)

View the document at its actual size.

Definition at line 468 of file kstandardaction.cpp.

QAction* KStandardAction::actualSize ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

View the document at its actual size.

Since
5.23
QAction * KStandardAction::addBookmark ( const QObject recvr,
const char *  slot,
QObject parent 
)

Add the current page to the bookmarks tree.

Definition at line 573 of file kstandardaction.cpp.

QAction* KStandardAction::addBookmark ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Add the current page to the bookmarks tree.

Since
5.23
QAction * KStandardAction::back ( const QObject recvr,
const char *  slot,
QObject parent 
)

Move back (web style menu).

Definition at line 513 of file kstandardaction.cpp.

QAction* KStandardAction::back ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Move back (web style menu).

Since
5.23
QAction * KStandardAction::clear ( const QObject recvr,
const char *  slot,
QObject parent 
)

Clear the content of the focus widget.

Definition at line 433 of file kstandardaction.cpp.

QAction* KStandardAction::clear ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Clear the content of the focus widget.

Since
5.23
QAction * KStandardAction::clear ( QObject parent)

Clear selected area.

Calls clear() on the widget with the current focus. Note that for some widgets, this may not provide the intended behavior. For example if you make use of the code above and a K3ListView has the focus, clear() will clear all of the items in the list. If this is not the intended behavior and you want to make use of this slot, you can subclass K3ListView and reimplement this slot. For example the following code would implement a K3ListView without this behavior:

class MyListView : public K3ListView {
Q_OBJECT
public:
MyListView( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ) : K3ListView( parent, name, f ) {}
virtual ~MyListView() {}
public Q_SLOTS:
virtual void clear() {}
};

Definition at line 624 of file kstandardaction.cpp.

QAction * KStandardAction::close ( const QObject recvr,
const char *  slot,
QObject parent 
)

Close the current document.

Definition at line 386 of file kstandardaction.cpp.

QAction* KStandardAction::close ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Close the current document.

Since
5.23
QAction * KStandardAction::configureNotifications ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display the notifications configuration dialog.

Definition at line 679 of file kstandardaction.cpp.

QAction* KStandardAction::configureNotifications ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display the notifications configuration dialog.

Since
5.23
QAction * KStandardAction::configureToolbars ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display the toolbar configuration dialog.

Definition at line 674 of file kstandardaction.cpp.

QAction* KStandardAction::configureToolbars ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display the toolbar configuration dialog.

Since
5.23
QAction * KStandardAction::copy ( const QObject recvr,
const char *  slot,
QObject parent 
)

Copy the selected area into the clipboard.

Definition at line 416 of file kstandardaction.cpp.

QAction* KStandardAction::copy ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Copy the selected area into the clipboard.

Since
5.23
QAction * KStandardAction::copy ( QObject parent)

Copy selected area and store it in the clipboard.

Calls copy() on the widget with the current focus.

Definition at line 614 of file kstandardaction.cpp.

QAction* KStandardAction::create ( StandardAction  id,
const QObject recvr,
Func  slot,
QObject parent 
)
inline

This overloads create() to allow using the new connect syntax.

Note
if you use OpenRecent as id, you should manually connect to the urlSelected(const QUrl &) signal of the returned KRecentFilesAction instead or use KStandardAction::openRecent(Receiver *, Func).
See also
create(StandardAction, const QObject *, const char *, QObject *)
Since
5.23

Definition at line 248 of file kstandardaction.h.

QAction * KStandardAction::create ( StandardAction  id,
const QObject recvr,
const char *  slot,
QObject parent 
)

Creates an action corresponding to one of the KStandardAction::StandardAction actions, which is connected to the given object and slot, and is owned by parent.

The signal that is connected to slot is triggered(bool), except for the case of OpenRecent standard action, which uses the urlSelected(const QUrl &) signal of KRecentFilesAction.

Parameters
idThe StandardAction identifier to create a QAction for.
recvrThe QObject to receive the signal, or nullptr if no notification is needed.
slotThe slot to connect the signal to (remember to use the SLOT() macro).
parentThe QObject that should own the created QAction, or nullptr if no parent will own the QAction returned (ensure you delete it manually in this case).

Definition at line 323 of file kstandardaction.cpp.

QAction * KStandardAction::cut ( const QObject recvr,
const char *  slot,
QObject parent 
)

Cut selected area and store it in the clipboard.

Definition at line 411 of file kstandardaction.cpp.

QAction* KStandardAction::cut ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Cut selected area and store it in the clipboard.

Since
5.23
QAction * KStandardAction::cut ( QObject parent)

Cut selected area and store it in the clipboard.

Calls cut() on the widget with the current focus.

Definition at line 609 of file kstandardaction.cpp.

QAction * KStandardAction::deleteFile ( const QObject recvr,
const char *  slot,
QObject parent 
)

Permanently deletes files or folders.

Since
5.25

Definition at line 726 of file kstandardaction.cpp.

QAction* KStandardAction::deleteFile ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Permanently deletes files or folders.

Since
5.25
QAction * KStandardAction::deselect ( const QObject recvr,
const char *  slot,
QObject parent 
)

Deselect any selected elements in the current document.

Definition at line 443 of file kstandardaction.cpp.

QAction* KStandardAction::deselect ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Deselect any selected elements in the current document.

Since
5.23
QAction * KStandardAction::documentBack ( const QObject recvr,
const char *  slot,
QObject parent 
)

Move back (document style menu).

Definition at line 563 of file kstandardaction.cpp.

QAction* KStandardAction::documentBack ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Move back (document style menu).

Since
5.23
QAction * KStandardAction::documentForward ( const QObject recvr,
const char *  slot,
QObject parent 
)

Move forward (document style menu).

Definition at line 568 of file kstandardaction.cpp.

QAction* KStandardAction::documentForward ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Move forward (document style menu).

Since
5.23
QAction * KStandardAction::donate ( const QObject recvr,
const char *  slot,
QObject parent 
)

Open donation page on kde.org.

Since
5.26

Definition at line 741 of file kstandardaction.cpp.

QAction* KStandardAction::donate ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Open donation page on kde.org.

Since
5.26
QAction * KStandardAction::editBookmarks ( const QObject recvr,
const char *  slot,
QObject parent 
)

Edit the application bookmarks.

Definition at line 578 of file kstandardaction.cpp.

QAction* KStandardAction::editBookmarks ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Edit the application bookmarks.

Since
5.23
QAction * KStandardAction::find ( const QObject recvr,
const char *  slot,
QObject parent 
)

Initiate a 'find' request in the current document.

Definition at line 448 of file kstandardaction.cpp.

QAction* KStandardAction::find ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Initiate a 'find' request in the current document.

Since
5.23
QAction * KStandardAction::findNext ( const QObject recvr,
const char *  slot,
QObject parent 
)

Find the next instance of a stored 'find'.

Definition at line 453 of file kstandardaction.cpp.

QAction* KStandardAction::findNext ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Find the next instance of a stored 'find'.

Since
5.23
QAction * KStandardAction::findPrev ( const QObject recvr,
const char *  slot,
QObject parent 
)

Find a previous instance of a stored 'find'.

Definition at line 458 of file kstandardaction.cpp.

QAction* KStandardAction::findPrev ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Find a previous instance of a stored 'find'.

Since
5.23
QAction * KStandardAction::firstPage ( const QObject recvr,
const char *  slot,
QObject parent 
)

Jump to the first page.

Definition at line 553 of file kstandardaction.cpp.

QAction* KStandardAction::firstPage ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Jump to the first page.

Since
5.23
QAction * KStandardAction::fitToHeight ( const QObject recvr,
const char *  slot,
QObject parent 
)

Fit the document view to the height of the current window.

Definition at line 483 of file kstandardaction.cpp.

QAction* KStandardAction::fitToHeight ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Fit the document view to the height of the current window.

Since
5.23
QAction * KStandardAction::fitToPage ( const QObject recvr,
const char *  slot,
QObject parent 
)

Fit the document view to the size of the current window.

Definition at line 473 of file kstandardaction.cpp.

QAction* KStandardAction::fitToPage ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Fit the document view to the size of the current window.

Since
5.23
QAction * KStandardAction::fitToWidth ( const QObject recvr,
const char *  slot,
QObject parent 
)

Fit the document view to the width of the current window.

Definition at line 478 of file kstandardaction.cpp.

QAction* KStandardAction::fitToWidth ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Fit the document view to the width of the current window.

Since
5.23
QAction * KStandardAction::forward ( const QObject recvr,
const char *  slot,
QObject parent 
)

Move forward (web style menu).

Definition at line 518 of file kstandardaction.cpp.

QAction* KStandardAction::forward ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Move forward (web style menu).

Since
5.23
KToggleFullScreenAction * KStandardAction::fullScreen ( const QObject recvr,
const char *  slot,
QWidget window,
QObject parent 
)

Switch to/from full screen mode.

Definition at line 648 of file kstandardaction.cpp.

KToggleFullScreenAction* KStandardAction::fullScreen ( const QObject recvr,
Func  slot,
QWidget window,
QObject parent 
)
inline

Switch to/from full screen mode.

Since
5.23

Definition at line 986 of file kstandardaction.h.

QAction * KStandardAction::goTo ( const QObject recvr,
const char *  slot,
QObject parent 
)

Jump to some specific location in the document.

Definition at line 538 of file kstandardaction.cpp.

QAction* KStandardAction::goTo ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Jump to some specific location in the document.

Since
5.23
QAction * KStandardAction::gotoLine ( const QObject recvr,
const char *  slot,
QObject parent 
)

Go to a specific line.

Definition at line 548 of file kstandardaction.cpp.

QAction* KStandardAction::gotoLine ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Go to a specific line.

Since
5.23
QAction * KStandardAction::gotoPage ( const QObject recvr,
const char *  slot,
QObject parent 
)

Go to a specific page.

Definition at line 543 of file kstandardaction.cpp.

QAction* KStandardAction::gotoPage ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Go to a specific page.

Since
5.23
KHamburgerMenu * KStandardAction::hamburgerMenu ( const QObject recvr,
const char *  slot,
QObject parent 
)

Opens a menu that substitutes the menubar.

Since
5.81

Definition at line 746 of file kstandardaction.cpp.

QAction* KStandardAction::hamburgerMenu ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Opens a menu that substitutes the menubar.

Since
5.81
QAction * KStandardAction::help ( const QObject recvr,
const char *  slot,
QObject parent 
)
Deprecated:
since 5.38 Use helpContents() instead.

Definition at line 685 of file kstandardaction.cpp.

QAction* KStandardAction::help ( const QObject recvr,
Func  slot,
QObject parent 
)
inline
Since
5.23
Deprecated:
since 5.38 Use helpContents() instead.
QAction * KStandardAction::helpContents ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display the handbook of the application.

Definition at line 691 of file kstandardaction.cpp.

QAction* KStandardAction::helpContents ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display the handbook of the application.

Since
5.23
QAction * KStandardAction::home ( const QObject recvr,
const char *  slot,
QObject parent 
)

Go to the "Home" position or document.

Definition at line 523 of file kstandardaction.cpp.

QAction* KStandardAction::home ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Go to the "Home" position or document.

Since
5.23
QAction * KStandardAction::keyBindings ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display the configure keyboard shortcuts dialog.

Note that you might be able to use the pre-built KXMLGUIFactory's function:

// For versions older than 5.84:
KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection());
// Starting from 5.84 you can use this (the KXMLGUIFactory::configureShortcuts() method is
// deprecated in 5.84):

Definition at line 664 of file kstandardaction.cpp.

QAction* KStandardAction::keyBindings ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display the configure key bindings dialog.

See also
keyBindings(const QObject *recvr, const char *slot, QObject *parent)
Since
5.23
QAction * KStandardAction::lastPage ( const QObject recvr,
const char *  slot,
QObject parent 
)

Jump to the last page.

Definition at line 558 of file kstandardaction.cpp.

QAction* KStandardAction::lastPage ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Jump to the last page.

Since
5.23
QAction * KStandardAction::mail ( const QObject recvr,
const char *  slot,
QObject parent 
)

Send the current document by mail.

Definition at line 391 of file kstandardaction.cpp.

QAction* KStandardAction::mail ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Mail this document.

Since
5.23
QAction * KStandardAction::moveToTrash ( const QObject recvr,
const char *  slot,
QObject parent 
)

Moves files or folders to the trash.

Since
5.25

Definition at line 736 of file kstandardaction.cpp.

QAction* KStandardAction::moveToTrash ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Moves files or folders to the trash.

Since
5.25
const char * KStandardAction::name ( StandardAction  id)

This will return the internal name of a given standard action.

Definition at line 340 of file kstandardaction.cpp.

QAction * KStandardAction::next ( const QObject recvr,
const char *  slot,
QObject parent 
)

Scroll down one page.

Definition at line 533 of file kstandardaction.cpp.

QAction* KStandardAction::next ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Scroll down one page.

Since
5.23
QAction* KStandardAction::open ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Open an existing file.

Since
5.23
QAction * KStandardAction::open ( const QObject recvr,
const char *  slot,
QObject parent 
)

Open an existing file.

Definition at line 351 of file kstandardaction.cpp.

QAction* KStandardAction::openNew ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Create a new document or window.

Since
5.23
QAction * KStandardAction::openNew ( const QObject recvr,
const char *  slot,
QObject parent 
)

Create a new document or window.

Definition at line 346 of file kstandardaction.cpp.

KRecentFilesAction* KStandardAction::openRecent ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

The same as openRecent(const QObject *, const char *, QObject *), but using new-style connect syntax.

See also
openRecent(const QObject *, const char *, QObject *)
Since
5.23

Definition at line 352 of file kstandardaction.h.

KRecentFilesAction * KStandardAction::openRecent ( const QObject recvr,
const char *  slot,
QObject parent 
)

Open a recently used document.

The signature of the slot being called is of the form slotURLSelected( const QUrl & ).

Parameters
recvrobject to receive slot
slotThe SLOT to invoke when a URL is selected. The slot's signature is slotURLSelected( const QUrl & ).
parentparent widget

Definition at line 356 of file kstandardaction.cpp.

QAction * KStandardAction::paste ( const QObject recvr,
const char *  slot,
QObject parent 
)

Paste the contents of clipboard at the current mouse or cursor position.

Definition at line 421 of file kstandardaction.cpp.

QAction* KStandardAction::paste ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Paste the contents of clipboard at the current mouse or cursor position.

Since
5.23
QAction * KStandardAction::paste ( QObject parent)

Paste the contents of clipboard at the current mouse or cursor Calls paste() on the widget with the current focus.

Definition at line 619 of file kstandardaction.cpp.

QAction * KStandardAction::pasteText ( const QObject recvr,
const char *  slot,
QObject parent 
)
Deprecated:
since 5.39.

Use paste() instead.

Definition at line 427 of file kstandardaction.cpp.

QAction* KStandardAction::pasteText ( const QObject recvr,
Func  slot,
QObject parent 
)
inline
Since
5.23
Deprecated:
since 5.39. Use paste() instead.
QAction * KStandardAction::preferences ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display the preferences/options dialog.

Definition at line 669 of file kstandardaction.cpp.

QAction* KStandardAction::preferences ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display the preferences/options dialog.

Since
5.23
QAction * KStandardAction::print ( const QObject recvr,
const char *  slot,
QObject parent 
)

Print the current document.

Definition at line 376 of file kstandardaction.cpp.

QAction* KStandardAction::print ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Print the current document.

Since
5.23
QAction * KStandardAction::printPreview ( const QObject recvr,
const char *  slot,
QObject parent 
)

Show a print preview of the current document.

Definition at line 381 of file kstandardaction.cpp.

QAction* KStandardAction::printPreview ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Show a print preview of the current document.

Since
5.23
QAction * KStandardAction::prior ( const QObject recvr,
const char *  slot,
QObject parent 
)

Scroll up one page.

Definition at line 528 of file kstandardaction.cpp.

QAction* KStandardAction::prior ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Scroll up one page.

Since
5.23
QAction * KStandardAction::quit ( const QObject recvr,
const char *  slot,
QObject parent 
)

Quit the program.

Note that you probably want to connect this action to either QWidget::close() or QApplication::closeAllWindows(), but not QApplication::quit(), so that KMainWindow::queryClose() is called on any open window (to warn the user about unsaved changes for example).

Definition at line 396 of file kstandardaction.cpp.

QAction* KStandardAction::quit ( const QObject recvr,
Func  slot,
QObject parent 
)
inline
QAction * KStandardAction::redisplay ( const QObject recvr,
const char *  slot,
QObject parent 
)

Redisplay or redraw the document.

Definition at line 503 of file kstandardaction.cpp.

QAction* KStandardAction::redisplay ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Redisplay or redraw the document.

Since
5.23
QAction * KStandardAction::redo ( const QObject recvr,
const char *  slot,
QObject parent 
)

Redo the last operation.

Definition at line 406 of file kstandardaction.cpp.

QAction* KStandardAction::redo ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Redo the last operation.

Since
5.23
QAction * KStandardAction::renameFile ( const QObject recvr,
const char *  slot,
QObject parent 
)

Renames files or folders.

Since
5.25

Definition at line 731 of file kstandardaction.cpp.

QAction* KStandardAction::renameFile ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Renames files or folders.

Since
5.25
QAction * KStandardAction::replace ( const QObject recvr,
const char *  slot,
QObject parent 
)

Find and replace matches.

Definition at line 463 of file kstandardaction.cpp.

QAction* KStandardAction::replace ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Find and replace matches.

Since
5.23
QAction * KStandardAction::reportBug ( const QObject recvr,
const char *  slot,
QObject parent 
)

Open up the Report Bug dialog.

Definition at line 706 of file kstandardaction.cpp.

QAction* KStandardAction::reportBug ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Open up the Report Bug dialog.

Since
5.23
QAction * KStandardAction::revert ( const QObject recvr,
const char *  slot,
QObject parent 
)

Revert the current document to the last saved version (essentially will undo all changes).

Definition at line 371 of file kstandardaction.cpp.

QAction* KStandardAction::revert ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Revert the current document to the last saved version (essentially will undo all changes).

Since
5.23
QAction * KStandardAction::save ( const QObject recvr,
const char *  slot,
QObject parent 
)

Save the current document.

Definition at line 361 of file kstandardaction.cpp.

QAction* KStandardAction::save ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Save the current document.

Since
5.23
QAction * KStandardAction::saveAs ( const QObject recvr,
const char *  slot,
QObject parent 
)

Save the current document under a different name.

Definition at line 366 of file kstandardaction.cpp.

QAction* KStandardAction::saveAs ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Save the current document under a different name.

Since
5.23
QAction * KStandardAction::saveOptions ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display the save options dialog.

Deprecated:
since 5.38

Definition at line 658 of file kstandardaction.cpp.

QAction* KStandardAction::saveOptions ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display the save options dialog.

Since
5.23
Deprecated:
since 5.38
QAction * KStandardAction::selectAll ( const QObject recvr,
const char *  slot,
QObject parent 
)

Select all elements in the current document.

Definition at line 438 of file kstandardaction.cpp.

QAction* KStandardAction::selectAll ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Select all elements in the current document.

Since
5.23
QAction * KStandardAction::selectAll ( QObject parent)

Calls selectAll() on the widget with the current focus.

Definition at line 629 of file kstandardaction.cpp.

KStandardShortcut::StandardShortcut KStandardAction::shortcutForActionId ( StandardAction  id)

Returns the standardshortcut associated with actionId.

Parameters
idThe identifier whose associated shortcut is wanted.
Since
4.2

Definition at line 51 of file kstandardaction.cpp.

KToggleAction * KStandardAction::showMenubar ( const QObject recvr,
const char *  slot,
QObject parent 
)

Show/Hide the menubar.

Definition at line 634 of file kstandardaction.cpp.

KToggleAction* KStandardAction::showMenubar ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

The same as showMenubar(const QObject *, const char *, QObject *), but using new-style connect syntax.

See also
showMenubar(const QObject *, const char *, QObject *)
Since
5.23

Definition at line 942 of file kstandardaction.h.

KToggleAction * KStandardAction::showStatusbar ( const QObject recvr,
const char *  slot,
QObject parent 
)

Show/Hide the statusbar.

Definition at line 641 of file kstandardaction.cpp.

KToggleAction* KStandardAction::showStatusbar ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Show/Hide the statusbar.

Since
5.23

Definition at line 964 of file kstandardaction.h.

QAction * KStandardAction::spelling ( const QObject recvr,
const char *  slot,
QObject parent 
)

Pop up the spell checker.

Definition at line 583 of file kstandardaction.cpp.

QAction* KStandardAction::spelling ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Pop up the spell checker.

Since
5.23
const char* KStandardAction::stdName ( StandardAction  act_enum)
inline
Deprecated:
Since 4.0, use name(StandardAction)

Definition at line 272 of file kstandardaction.h.

QStringList KStandardAction::stdNames ( )

Returns a list of all standard names.

Used by KAccelManager to give those higher weight.

Definition at line 35 of file kstandardaction.cpp.

QAction * KStandardAction::switchApplicationLanguage ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display the Switch Application Language dialog.

Since
5.67

Definition at line 711 of file kstandardaction.cpp.

QAction* KStandardAction::switchApplicationLanguage ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display the Switch Application Language dialog.

Since
5.67
QAction * KStandardAction::tipOfDay ( const QObject recvr,
const char *  slot,
QObject parent 
)

Display "Tip of the Day".

Definition at line 701 of file kstandardaction.cpp.

QAction* KStandardAction::tipOfDay ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Display "Tip of the Day".

Since
5.23
QAction * KStandardAction::undo ( const QObject recvr,
const char *  slot,
QObject parent 
)

Undo the last operation.

Definition at line 401 of file kstandardaction.cpp.

QAction* KStandardAction::undo ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Undo the last operation.

Since
5.23
QAction * KStandardAction::up ( const QObject recvr,
const char *  slot,
QObject parent 
)

Move up (web style menu).

Definition at line 508 of file kstandardaction.cpp.

QAction* KStandardAction::up ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Move up (web style menu).

Since
5.23
QAction * KStandardAction::whatsThis ( const QObject recvr,
const char *  slot,
QObject parent 
)

Trigger the What's This cursor.

Definition at line 696 of file kstandardaction.cpp.

QAction* KStandardAction::whatsThis ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Trigger the What's This cursor.

Since
5.23
QAction * KStandardAction::zoom ( const QObject recvr,
const char *  slot,
QObject parent 
)

Select the current zoom level.

Definition at line 498 of file kstandardaction.cpp.

QAction* KStandardAction::zoom ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Select the current zoom level.

Since
5.23
QAction * KStandardAction::zoomIn ( const QObject recvr,
const char *  slot,
QObject parent 
)

Zoom in the current document view.

Definition at line 488 of file kstandardaction.cpp.

QAction* KStandardAction::zoomIn ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Zoom in the current document view.

Since
5.23
QAction * KStandardAction::zoomOut ( const QObject recvr,
const char *  slot,
QObject parent 
)

Zoom out the current document view.

Definition at line 493 of file kstandardaction.cpp.

QAction* KStandardAction::zoomOut ( const QObject recvr,
Func  slot,
QObject parent 
)
inline

Zoom out the current document view.

Since
5.23
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 22:45:47 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.