Krita Source Code Documentation
Loading...
Searching...
No Matches
KStandardAction Namespace Reference

Classes

class  AutomaticAction
 
struct  KStandardActionInfo
 

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 , ResetConfigurations , Help ,
  HelpContents , WhatsThis , ReportBug , AboutApp ,
  AboutKDE , TipofDay , ConfigureNotifications , FullScreen ,
  Clear , PasteText , SwitchApplicationLanguage
}
 

Functions

QAction * aboutApp (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * aboutKDE (const QObject *recvr, const char *slot, QObject *parent)
 
QList< StandardActionactionIds ()
 
QAction * actualSize (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * addBookmark (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * back (const QObject *recvr, const char *slot, QObject *parent)
 
static QAction * buildAutomaticAction (QObject *parent, StandardAction id, const char *slot)
 
QAction * clear (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * clear (QObject *parent)
 
QAction * close (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * configureNotifications (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * configureToolbars (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * copy (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * copy (QObject *parent)
 
QAction * create (StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
 
QAction * cut (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * cut (QObject *parent)
 
QAction * deselect (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * documentBack (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * documentForward (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * editBookmarks (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * find (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * findNext (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * findPrev (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * firstPage (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * fitToHeight (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * fitToPage (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * fitToWidth (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * forward (const QObject *recvr, const char *slot, QObject *parent)
 
KToggleFullScreenAction * fullScreen (const QObject *recvr, const char *slot, QWidget *window, QObject *parent)
 
QAction * goTo (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * gotoLine (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * gotoPage (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * help (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * helpContents (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * home (const QObject *recvr, const char *slot, QObject *parent)
 
const KStandardActionInfoinfoPtr (StandardAction id)
 
static QStringList internal_stdNames ()
 
QAction * keyBindings (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * lastPage (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * mail (const QObject *recvr, const char *slot, QObject *parent)
 
const char * name (StandardAction id)
 
QAction * next (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * open (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * openNew (const QObject *recvr, const char *slot, QObject *parent)
 
KRecentFilesActionopenRecent (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * paste (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * paste (QObject *parent)
 
QAction * pasteText (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * preferences (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * print (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * printPreview (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * prior (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * quit (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * redisplay (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * redo (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * replace (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * reportBug (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * resetConfigurations (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * revert (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * save (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * saveAs (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * saveOptions (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * selectAll (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * selectAll (QObject *parent)
 
KRITAWIDGETUTILS_EXPORT KStandardShortcut::StandardShortcut shortcutForActionId (StandardAction id)
 
KToggleAction * showMenubar (const QObject *recvr, const char *slot, QObject *parent)
 
KToggleAction * showStatusbar (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * spelling (const QObject *recvr, const char *slot, QObject *parent)
 
KRITAWIDGETUTILS_DEPRECATED const char * stdName (StandardAction act_enum)
 
QStringList stdNames ()
 
QAction * switchApplicationLanguage (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * tipOfDay (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * undo (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * up (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * whatsThis (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * zoom (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * zoomIn (const QObject *recvr, const char *slot, QObject *parent)
 
QAction * zoomOut (const QObject *recvr, const char *slot, QObject *parent)
 

Variables

static constexpr KStandardActionInfo g_rgActionInfo []
 

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 UI Style Guide.

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"), KisIconUtils::loadIcon("document-new"),
KStandardShortcut::shortcut(KStandardShortcut::New), this,
SLOT(fileNew()), actionCollection());
QIcon loadIcon(const QString &name)

You could drop that and replace it with:

QAction *newAct = KStandardAction::openNew(this, SLOT(fileNew()),
actionCollection());
QAction * openNew(const QObject *recvr, const char *slot, QObject *parent)

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");
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)
QAction * cut(const QObject *recvr, const char *slot, QObject *parent)

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));
const char * name(StandardAction id)

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.nosp@m.oth@.nosp@m.kde.o.nosp@m.rg

Enumeration Type Documentation

◆ StandardAction

The standard menubar and toolbar actions.

Enumerator
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 
ResetConfigurations 
Help 
HelpContents 
WhatsThis 
ReportBug 
AboutApp 
AboutKDE 
TipofDay 
ConfigureNotifications 
FullScreen 
Clear 
PasteText 
SwitchApplicationLanguage 

Definition at line 111 of file kstandardaction.h.

111 {
113
114 // File Menu
117
118 // Edit Menu
120 Replace,
121
122 // View Menu
125
126 // Go Menu
127 Up, Back, Forward, Home /*Home page*/, Prior, Next, Goto, GotoPage, GotoLine,
129
130 // Bookmarks Menu
132
133 // Tools Menu
134 Spelling,
135
136 // Settings Menu
140
141 // Help Menu
143 TipofDay,
144
145 // Other standard actions
148 Clear,
149 PasteText,
151};

Function Documentation

◆ aboutApp()

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

Display the application's About box.

Definition at line 623 of file kstandardaction.cpp.

624{
625 return KStandardAction::create(AboutApp, recvr, slot, parent);
626}
QAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)

References AboutApp, and create().

◆ aboutKDE()

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

Display the About KDE dialog.

Definition at line 628 of file kstandardaction.cpp.

629{
630 return KStandardAction::create(AboutKDE, recvr, slot, parent);
631}

References AboutKDE, and create().

◆ actionIds()

KRITAWIDGETUTILS_EXPORT QList< StandardAction > KStandardAction::actionIds ( )

Returns a list of all actionIds.

Since
4.2

Definition at line 43 of file kstandardaction.cpp.

44{
46
47 for (uint i = 0; g_rgActionInfo[i].id != ActionNone; i++) {
48 result.append(g_rgActionInfo[i].id);
49 }
50
51 return result;
52}
unsigned int uint

References ActionNone, g_rgActionInfo, and KStandardAction::KStandardActionInfo::id.

◆ actualSize()

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

View the document at its actual size.

Definition at line 335 of file kstandardaction.cpp.

336{
337 return KStandardAction::create(ActualSize, recvr, slot, parent);
338}

References ActualSize, and create().

◆ addBookmark()

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

Add the current page to the bookmarks tree.

Definition at line 440 of file kstandardaction.cpp.

441{
442 return KStandardAction::create(AddBookmark, recvr, slot, parent);
443}

References AddBookmark, and create().

◆ back()

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

Move back (web style menu).

Definition at line 380 of file kstandardaction.cpp.

381{
382 return KStandardAction::create(Back, recvr, slot, parent);
383}

References Back, and create().

◆ buildAutomaticAction()

static QAction * KStandardAction::buildAutomaticAction ( QObject * parent,
StandardAction id,
const char * slot )
static

Definition at line 455 of file kstandardaction.cpp.

456{
457 const KStandardActionInfo *p = infoPtr(id);
458 if (!p) {
459 return 0;
460 }
461
462 AutomaticAction *action = new AutomaticAction(
463 KisIconUtils::loadIcon(p->psIconName),
464 i18n(p->psLabel),
465 KStandardShortcut::shortcut(p->idAccel),
466 slot,
467 parent);
468
469 action->setObjectName(p->psName);
470 if (p->psToolTip) {
471 action->setToolTip(i18n(p->psToolTip));
472 }
473
474 if (parent && parent->inherits("KisKActionCollection")) {
475 QMetaObject::invokeMethod(parent, "addAction", Q_ARG(QString, action->objectName()), Q_ARG(QAction *, action));
476 }
477
478 return action;
479}
const Params2D p
const KStandardActionInfo * infoPtr(StandardAction id)
ChildIterator< value_type, is_const > parent(const ChildIterator< value_type, is_const > &it)
Definition KisForest.h:327

References infoPtr(), KisIconUtils::loadIcon(), and p.

◆ clear() [1/2]

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

Clear the content of the focus widget

Definition at line 300 of file kstandardaction.cpp.

301{
302 return KStandardAction::create(Clear, recvr, slot, parent);
303}

References Clear, and create().

◆ clear() [2/2]

KRITAWIDGETUTILS_EXPORT 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 = Qt::WindowFlags() ) : K3ListView( parent, name, f ) {}
virtual ~MyListView() {}
public Q_SLOTS:
virtual void clear() {}
};
QAction * clear(const QObject *recvr, const char *slot, QObject *parent)

Definition at line 496 of file kstandardaction.cpp.

497{
498 return buildAutomaticAction(parent, Clear, SLOT(clear()));
499}
static QAction * buildAutomaticAction(QObject *parent, StandardAction id, const char *slot)

References buildAutomaticAction(), clear(), and Clear.

◆ close()

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

Close the current document.

Definition at line 255 of file kstandardaction.cpp.

256{
257 return KStandardAction::create(Close, recvr, slot, parent);
258}

References Close, and create().

◆ configureNotifications()

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

The Configure Notifications dialog.

Definition at line 588 of file kstandardaction.cpp.

589{
590 return KStandardAction::create(ConfigureNotifications, recvr, slot, parent);
591}

References ConfigureNotifications, and create().

◆ configureToolbars()

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

The Customize Toolbar dialog.

Definition at line 578 of file kstandardaction.cpp.

579{
580 return KStandardAction::create(ConfigureToolbars, recvr, slot, parent);
581}

References ConfigureToolbars, and create().

◆ copy() [1/2]

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

Copy the selected area into the clipboard.

Definition at line 285 of file kstandardaction.cpp.

286{
287 return KStandardAction::create(Copy, recvr, slot, parent);
288}

References Copy, and create().

◆ copy() [2/2]

KRITAWIDGETUTILS_EXPORT 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 486 of file kstandardaction.cpp.

487{
488 return buildAutomaticAction(parent, Copy, SLOT(copy()));
489}

References buildAutomaticAction(), copy(), and Copy.

◆ create()

KRITAWIDGETUTILS_EXPORT 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 0 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 0 if no parent will own the QAction returned (ensure you delete it manually in this case).

Definition at line 60 of file kstandardaction.cpp.

61{
62 static bool stdNamesInitialized = false;
63
64 if (!stdNamesInitialized) {
65 KAcceleratorManager::addStandardActionNames(stdNames());
66 stdNamesInitialized = true;
67 }
68
69 QAction *pAction = 0;
70 const KStandardActionInfo *pInfo = infoPtr(id);
71
72 // qDebug() << "KStandardAction::create( " << id << "=" << (pInfo ? pInfo->psName : (const char*)0) << ", " << parent << " )"; // ellis
73
74 if (pInfo) {
75 QString sLabel, iconName = pInfo->psIconName;
76 switch (id) {
77 case Back:
78 sLabel = i18nc("go back", "&Back");
79 if (QApplication::isRightToLeft()) {
80 iconName = "go-next";
81 }
82 break;
83
84 case Forward:
85 sLabel = i18nc("go forward", "&Forward");
86 if (QApplication::isRightToLeft()) {
87 iconName = "go-previous";
88 }
89 break;
90
91 case Home:
92 sLabel = i18nc("home page", "&Home");
93 break;
94 case Help:
95 sLabel = i18nc("show help", "&Help");
96 break;
97 case Preferences:
98 case AboutApp:
99 case HelpContents: {
100 QString appDisplayName = QGuiApplication::applicationDisplayName();
101 if (appDisplayName.isEmpty()) {
102 appDisplayName = QCoreApplication::applicationName();
103 }
104 sLabel = i18n(pInfo->psLabel, appDisplayName);
105 }
106 break;
107 default:
108 sLabel = i18n(pInfo->psLabel);
109 }
110
111 if (QApplication::isRightToLeft()) {
112 switch (id) {
113 case Prior: iconName = "go-next-view-page"; break;
114 case Next: iconName = "go-previous-view-page"; break;
115 case FirstPage: iconName = "go-last-view-page"; break;
116 case LastPage: iconName = "go-first-view-page"; break;
117 case DocumentBack: iconName = "go-next"; break;
118 case DocumentForward: iconName = "go-previous"; break;
119 default: break;
120 }
121 }
122
123 QIcon icon = iconName.isEmpty() ? QIcon() : KisIconUtils::loadIcon(iconName);
124
125 switch (id) {
126 case OpenRecent:
127 pAction = new KRecentFilesAction(parent);
128 break;
129 case ShowMenubar:
130 case ShowToolbar:
131 case ShowStatusbar:
132 pAction = new QAction(parent);
133 pAction->setCheckable(true);
134 pAction->setChecked(true);
135 break;
136 case FullScreen:
137 pAction = new KToggleFullScreenAction(parent);
138 pAction->setCheckable(true);
139 break;
140 case PasteText:
141 pAction = new QAction(parent);
142 break;
143 // Same as default, but with the app icon
144 case AboutApp:
145 {
146 pAction = new QAction(parent);
147 icon = qApp->windowIcon();
148 break;
149 }
150
151 default:
152 pAction = new QAction(parent);
153 break;
154 }
155
156 switch (id) {
157 case Quit:
158 pAction->setMenuRole(QAction::QuitRole);
159 break;
160
161 case Preferences:
162 pAction->setMenuRole(QAction::PreferencesRole);
163 break;
164
165 case AboutApp:
166 pAction->setMenuRole(QAction::AboutRole);
167 break;
168
169 default:
170 pAction->setMenuRole(QAction::NoRole);
171 break;
172 }
173
174 pAction->setText(sLabel);
175 if (pInfo->psToolTip) {
176 pAction->setToolTip(i18n(pInfo->psToolTip));
177 }
178 pAction->setIcon(icon);
179
180 QList<QKeySequence> cut = KStandardShortcut::shortcut(pInfo->idAccel);
181 if (!cut.isEmpty()) {
182 // emulate KisKActionCollection::setDefaultShortcuts to allow the use of "configure shortcuts"
183 pAction->setShortcuts(cut);
184 pAction->setProperty("defaultShortcuts", QVariant::fromValue(cut));
185 }
186
187 pAction->setObjectName(pInfo->psName);
188 }
189
190 if (recvr && slot) {
191 if (id == OpenRecent) {
192 // FIXME QAction port: probably a good idea to find a cleaner way to do this
193 // Open Recent is a special case - provide the selected URL
194 QObject::connect(pAction, SIGNAL(urlSelected(QUrl)), recvr, slot);
195 } else if (id == ConfigureToolbars) { // #200815
196 QObject::connect(pAction, SIGNAL(triggered(bool)), recvr, slot, Qt::QueuedConnection);
197 } else {
198 QObject::connect(pAction, SIGNAL(triggered(bool)), recvr, slot);
199 }
200 }
201
202 if (pAction && parent && parent->inherits("KisKActionCollection")) {
203 QMetaObject::invokeMethod(parent, "addAction", Q_ARG(QString, pAction->objectName()), Q_ARG(QAction *, pAction));
204 }
205
206 return pAction;
207}
Recent files action.
QStringList stdNames()

References AboutApp, Back, ConfigureToolbars, cut(), DocumentBack, DocumentForward, FirstPage, Forward, FullScreen, Help, HelpContents, Home, KStandardAction::KStandardActionInfo::idAccel, infoPtr(), LastPage, KisIconUtils::loadIcon(), Next, OpenRecent, PasteText, Preferences, Prior, KStandardAction::KStandardActionInfo::psIconName, KStandardAction::KStandardActionInfo::psLabel, KStandardAction::KStandardActionInfo::psName, KStandardAction::KStandardActionInfo::psToolTip, Quit, ShowMenubar, ShowStatusbar, ShowToolbar, and stdNames().

◆ cut() [1/2]

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

Cut selected area and store it in the clipboard.

Definition at line 280 of file kstandardaction.cpp.

281{
282 return KStandardAction::create(Cut, recvr, slot, parent);
283}

References create(), and Cut.

◆ cut() [2/2]

KRITAWIDGETUTILS_EXPORT 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 481 of file kstandardaction.cpp.

482{
483 return buildAutomaticAction(parent, Cut, SLOT(cut()));
484}

References buildAutomaticAction(), cut(), and Cut.

◆ deselect()

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

Deselect any selected elements in the current document.

Definition at line 310 of file kstandardaction.cpp.

311{
312 return KStandardAction::create(Deselect, recvr, slot, parent);
313}

References create(), and Deselect.

◆ documentBack()

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

Move back (document style menu).

Definition at line 430 of file kstandardaction.cpp.

431{
432 return KStandardAction::create(DocumentBack, recvr, slot, parent);
433}

References create(), and DocumentBack.

◆ documentForward()

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

Move forward (document style menu).

Definition at line 435 of file kstandardaction.cpp.

436{
437 return KStandardAction::create(DocumentForward, recvr, slot, parent);
438}

References create(), and DocumentForward.

◆ editBookmarks()

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

Edit the application bookmarks.

Definition at line 445 of file kstandardaction.cpp.

446{
447 return KStandardAction::create(EditBookmarks, recvr, slot, parent);
448}

References create(), and EditBookmarks.

◆ find()

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

Initiate a 'find' request in the current document.

Definition at line 315 of file kstandardaction.cpp.

316{
317 return KStandardAction::create(Find, recvr, slot, parent);
318}

References create(), and Find.

◆ findNext()

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

Find the next instance of a stored 'find'.

Definition at line 320 of file kstandardaction.cpp.

321{
322 return KStandardAction::create(FindNext, recvr, slot, parent);
323}

References create(), and FindNext.

◆ findPrev()

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

Find a previous instance of a stored 'find'.

Definition at line 325 of file kstandardaction.cpp.

326{
327 return KStandardAction::create(FindPrev, recvr, slot, parent);
328}

References create(), and FindPrev.

◆ firstPage()

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

Jump to the first page.

Definition at line 420 of file kstandardaction.cpp.

421{
422 return KStandardAction::create(FirstPage, recvr, slot, parent);
423}

References create(), and FirstPage.

◆ fitToHeight()

KRITAWIDGETUTILS_EXPORT 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 350 of file kstandardaction.cpp.

351{
352 return KStandardAction::create(FitToHeight, recvr, slot, parent);
353}

References create(), and FitToHeight.

◆ fitToPage()

KRITAWIDGETUTILS_EXPORT 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 340 of file kstandardaction.cpp.

341{
342 return KStandardAction::create(FitToPage, recvr, slot, parent);
343}

References create(), and FitToPage.

◆ fitToWidth()

KRITAWIDGETUTILS_EXPORT 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 345 of file kstandardaction.cpp.

346{
347 return KStandardAction::create(FitToWidth, recvr, slot, parent);
348}

References create(), and FitToWidth.

◆ forward()

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

Move forward (web style menu).

Definition at line 385 of file kstandardaction.cpp.

386{
387 return KStandardAction::create(Forward, recvr, slot, parent);
388}

References create(), and Forward.

◆ fullScreen()

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

Switch to/from full screen mode

Definition at line 554 of file kstandardaction.cpp.

555{
556 KToggleFullScreenAction *ret;
557 ret = static_cast< KToggleFullScreenAction * >(KStandardAction::create(FullScreen, recvr, slot, parent));
558 ret->setWindow(window);
559
560 return ret;
561}

References create(), and FullScreen.

◆ goTo()

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

Go to somewhere in general.

Definition at line 405 of file kstandardaction.cpp.

406{
407 return KStandardAction::create(Goto, recvr, slot, parent);
408}

References create(), and Goto.

◆ gotoLine()

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

Go to a specific line (dialog).

Definition at line 415 of file kstandardaction.cpp.

416{
417 return KStandardAction::create(GotoLine, recvr, slot, parent);
418}

References create(), and GotoLine.

◆ gotoPage()

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

Go to a specific page (dialog).

Definition at line 410 of file kstandardaction.cpp.

411{
412 return KStandardAction::create(GotoPage, recvr, slot, parent);
413}

References create(), and GotoPage.

◆ help()

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

Display the help.

Definition at line 593 of file kstandardaction.cpp.

594{
595 return KStandardAction::create(Help, recvr, slot, parent);
596}

References create(), and Help.

◆ helpContents()

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

Display the help contents.

Definition at line 598 of file kstandardaction.cpp.

599{
600 return KStandardAction::create(HelpContents, recvr, slot, parent);
601}

References create(), and HelpContents.

◆ home()

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

Go to the "Home" position or document.

Definition at line 390 of file kstandardaction.cpp.

391{
392 return KStandardAction::create(Home, recvr, slot, parent);
393}

References create(), and Home.

◆ infoPtr()

const KStandardActionInfo * KStandardAction::infoPtr ( StandardAction id)
inline

Definition at line 110 of file kstandardaction_p.h.

111{
112 for (uint i = 0; g_rgActionInfo[i].id != ActionNone; i++) {
113 if (g_rgActionInfo[i].id == id) {
114 return &g_rgActionInfo[i];
115 }
116 }
117
118 return 0;
119}
static constexpr KStandardActionInfo g_rgActionInfo[]

References ActionNone, g_rgActionInfo, and KStandardAction::KStandardActionInfo::id.

◆ internal_stdNames()

static QStringList KStandardAction::internal_stdNames ( )
inlinestatic

Definition at line 121 of file kstandardaction_p.h.

122{
123 QStringList result;
124
125 for (uint i = 0; g_rgActionInfo[i].id != ActionNone; i++)
126 if (g_rgActionInfo[i].psLabel) {
127 if (QByteArray(g_rgActionInfo[i].psLabel).contains("%1"))
128 // Prevents i18n from complaining about unsubstituted placeholder.
129 {
130 result.append(i18n(g_rgActionInfo[i].psLabel, QString()));
131 } else {
132 result.append(i18n(g_rgActionInfo[i].psLabel));
133 }
134 }
135
136 return result;
137}

References ActionNone, g_rgActionInfo, and KStandardAction::KStandardActionInfo::id.

◆ keyBindings()

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

Display the configure key bindings dialog.

Note that you might be able to use the pre-built KisKXMLGUIFactory's function: KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection());

Definition at line 568 of file kstandardaction.cpp.

569{
570 return KStandardAction::create(KeyBindings, recvr, slot, parent);
571}

References create(), and KeyBindings.

◆ lastPage()

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

Jump to the last page.

Definition at line 425 of file kstandardaction.cpp.

426{
427 return KStandardAction::create(LastPage, recvr, slot, parent);
428}

References create(), and LastPage.

◆ mail()

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

Mail this document.

Definition at line 260 of file kstandardaction.cpp.

261{
262 return KStandardAction::create(Mail, recvr, slot, parent);
263}

References create(), and Mail.

◆ name()

KRITAWIDGETUTILS_EXPORT const char * KStandardAction::name ( StandardAction id)

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

Definition at line 209 of file kstandardaction.cpp.

210{
211 const KStandardActionInfo *pInfo = infoPtr(id);
212 return (pInfo) ? pInfo->psName : 0;
213}

References infoPtr(), and KStandardAction::KStandardActionInfo::psName.

◆ next()

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

Scroll down one page.

Definition at line 400 of file kstandardaction.cpp.

401{
402 return KStandardAction::create(Next, recvr, slot, parent);
403}

References create(), and Next.

◆ open()

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

Open an existing file.

Definition at line 220 of file kstandardaction.cpp.

221{
222 return KStandardAction::create(Open, recvr, slot, parent);
223}

References create(), and Open.

◆ openNew()

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

Create a new document or window.

Definition at line 215 of file kstandardaction.cpp.

216{
217 return KStandardAction::create(New, recvr, slot, parent);
218}

References create(), and New.

◆ openRecent()

KRITAWIDGETUTILS_EXPORT 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 225 of file kstandardaction.cpp.

226{
227 return (KRecentFilesAction *) KStandardAction::create(OpenRecent, recvr, slot, parent);
228}

References create(), and OpenRecent.

◆ paste() [1/2]

KRITAWIDGETUTILS_EXPORT 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 290 of file kstandardaction.cpp.

291{
292 return KStandardAction::create(Paste, recvr, slot, parent);
293}

References create(), and Paste.

◆ paste() [2/2]

KRITAWIDGETUTILS_EXPORT 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 491 of file kstandardaction.cpp.

492{
493 return buildAutomaticAction(parent, Paste, SLOT(paste()));
494}
QAction * paste(const QObject *recvr, const char *slot, QObject *parent)

References buildAutomaticAction(), paste(), and Paste.

◆ pasteText()

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

Paste the contents of clipboard at the current mouse or cursor position. Provide a button on the toolbar with the clipboard history menu if Klipper is running.

Definition at line 295 of file kstandardaction.cpp.

296{
297 return KStandardAction::create(PasteText, recvr, slot, parent);
298}

References create(), and PasteText.

◆ preferences()

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

Display the preferences/options dialog.

Definition at line 573 of file kstandardaction.cpp.

574{
575 return KStandardAction::create(Preferences, recvr, slot, parent);
576}

References create(), and Preferences.

◆ print()

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

Print the current document.

Definition at line 245 of file kstandardaction.cpp.

246{
247 return KStandardAction::create(Print, recvr, slot, parent);
248}

References create(), and Print.

◆ printPreview()

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

Show a print preview of the current document.

Definition at line 250 of file kstandardaction.cpp.

251{
252 return KStandardAction::create(PrintPreview, recvr, slot, parent);
253}

References create(), and PrintPreview.

◆ prior()

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

Scroll up one page.

Definition at line 395 of file kstandardaction.cpp.

396{
397 return KStandardAction::create(Prior, recvr, slot, parent);
398}

References create(), and Prior.

◆ quit()

KRITAWIDGETUTILS_EXPORT 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 KisKMainWindow::queryClose() is called on any open window (to warn the user about unsaved changes for example).

Definition at line 265 of file kstandardaction.cpp.

266{
267 return KStandardAction::create(Quit, recvr, slot, parent);
268}

References create(), and Quit.

◆ redisplay()

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

Redisplay or redraw the document.

Definition at line 370 of file kstandardaction.cpp.

371{
372 return KStandardAction::create(Redisplay, recvr, slot, parent);
373}

References create(), and Redisplay.

◆ redo()

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

Redo the last operation.

Definition at line 275 of file kstandardaction.cpp.

276{
277 return KStandardAction::create(Redo, recvr, slot, parent);
278}

References create(), and Redo.

◆ replace()

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

Find and replace matches.

Definition at line 330 of file kstandardaction.cpp.

331{
332 return KStandardAction::create(Replace, recvr, slot, parent);
333}

References create(), and Replace.

◆ reportBug()

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

Open up the Report Bug dialog.

Definition at line 613 of file kstandardaction.cpp.

614{
615 return KStandardAction::create(ReportBug, recvr, slot, parent);
616}

References create(), and ReportBug.

◆ resetConfigurations()

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

Definition at line 583 of file kstandardaction.cpp.

584{
585 return KStandardAction::create(ResetConfigurations, recvr, slot, parent);
586}

References create(), and ResetConfigurations.

◆ revert()

KRITAWIDGETUTILS_EXPORT 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 240 of file kstandardaction.cpp.

241{
242 return KStandardAction::create(Revert, recvr, slot, parent);
243}

References create(), and Revert.

◆ save()

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

Save the current document.

Definition at line 230 of file kstandardaction.cpp.

231{
232 return KStandardAction::create(Save, recvr, slot, parent);
233}

References create(), and Save.

◆ saveAs()

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

Save the current document under a different name.

Definition at line 235 of file kstandardaction.cpp.

236{
237 return KStandardAction::create(SaveAs, recvr, slot, parent);
238}

References create(), and SaveAs.

◆ saveOptions()

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

Display the save options dialog.

Definition at line 563 of file kstandardaction.cpp.

564{
565 return KStandardAction::create(SaveOptions, recvr, slot, parent);
566}

References create(), and SaveOptions.

◆ selectAll() [1/2]

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

Select all elements in the current document.

Definition at line 305 of file kstandardaction.cpp.

306{
307 return KStandardAction::create(SelectAll, recvr, slot, parent);
308}

References create(), and SelectAll.

◆ selectAll() [2/2]

KRITAWIDGETUTILS_EXPORT QAction * KStandardAction::selectAll ( QObject * parent)

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

Definition at line 501 of file kstandardaction.cpp.

502{
503 return buildAutomaticAction(parent, SelectAll, SLOT(selectAll()));
504}
QAction * selectAll(const QObject *recvr, const char *slot, QObject *parent)

References buildAutomaticAction(), selectAll(), and SelectAll.

◆ shortcutForActionId()

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

Returns the standardshortcut associated with actionId.

Parameters
idThe actionId whose associated shortcut is wanted.
Since
4.2

Definition at line 54 of file kstandardaction.cpp.

55{
56 const KStandardActionInfo *pInfo = infoPtr(id);
57 return (pInfo) ? pInfo->idAccel : KStandardShortcut::AccelNone;
58}
KStandardShortcut::StandardShortcut idAccel

References KStandardAction::KStandardActionInfo::idAccel, and infoPtr().

◆ showMenubar()

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

Show/Hide the menubar.

Definition at line 506 of file kstandardaction.cpp.

507{
508 KToggleAction *ret = new KToggleAction(i18n("Show &Menubar"), parent);
509 ret->setObjectName(name(ShowMenubar));
510 ret->setIcon(KisIconUtils::loadIcon("show-menu"));
511
512 // emulate KisKActionCollection::setDefaultShortcuts to allow the use of "configure shortcuts"
513// This shortcut is dangerous and should not be enabled by default.
514// ret->setShortcuts(KStandardShortcut::shortcut(KStandardShortcut::ShowMenubar));
515// ret->setProperty("defaultShortcuts", QVariant::fromValue(KStandardShortcut::shortcut(KStandardShortcut::ShowMenubar)));
516
517 ret->setWhatsThis(i18n("Show Menubar<p>"
518 "Shows the menubar again after it has been hidden</p>"));
519
520 ret->setChecked(true);
521
522 if (recvr && slot) {
523 QObject::connect(ret, SIGNAL(triggered(bool)), recvr, slot);
524 }
525
526 if (parent && parent->inherits("KisKActionCollection")) {
527 QMetaObject::invokeMethod(parent, "addAction", Q_ARG(QString, ret->objectName()), Q_ARG(QAction *, ret));
528 }
529
530 return ret;
531}

References KisIconUtils::loadIcon(), name(), and ShowMenubar.

◆ showStatusbar()

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

Show/Hide the statusbar.

Definition at line 533 of file kstandardaction.cpp.

534{
535 KToggleAction *ret = new KToggleAction(i18n("Show St&atusbar"), parent);
536 ret->setObjectName(name(ShowStatusbar));
537
538 ret->setWhatsThis(i18n("Show Statusbar<p>"
539 "Shows the statusbar, which is the bar at the bottom of the window used for status information.</p>"));
540
541 ret->setChecked(true);
542
543 if (recvr && slot) {
544 QObject::connect(ret, SIGNAL(triggered(bool)), recvr, slot);
545 }
546
547 if (parent && parent->inherits("KisKActionCollection")) {
548 QMetaObject::invokeMethod(parent, "addAction", Q_ARG(QString, ret->objectName()), Q_ARG(QAction *, ret));
549 }
550
551 return ret;
552}

References name(), and ShowStatusbar.

◆ spelling()

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

Pop up the spell checker.

Definition at line 450 of file kstandardaction.cpp.

451{
452 return KStandardAction::create(Spelling, recvr, slot, parent);
453}

References create(), and Spelling.

◆ stdName()

KRITAWIDGETUTILS_DEPRECATED const char * KStandardAction::stdName ( StandardAction act_enum)
inline
Deprecated
use name()

Definition at line 179 of file kstandardaction.h.

180{
181 return name(act_enum);
182}

References name().

◆ stdNames()

KRITAWIDGETUTILS_EXPORT QStringList KStandardAction::stdNames ( )

Returns a list of all standard names. Used by KAccelManager to give those higher weight.

Definition at line 38 of file kstandardaction.cpp.

39{
40 return internal_stdNames();
41}

References internal_stdNames().

◆ switchApplicationLanguage()

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

Definition at line 618 of file kstandardaction.cpp.

619{
620 return KStandardAction::create(SwitchApplicationLanguage, recvr, slot, parent);
621}

References create(), and SwitchApplicationLanguage.

◆ tipOfDay()

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

Display "Tip of the Day"

Definition at line 608 of file kstandardaction.cpp.

609{
610 return KStandardAction::create(TipofDay, recvr, slot, parent);
611}

References create(), and TipofDay.

◆ undo()

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

Undo the last operation.

Definition at line 270 of file kstandardaction.cpp.

271{
272 return KStandardAction::create(Undo, recvr, slot, parent);
273}

References create(), and Undo.

◆ up()

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

Move up (web style menu).

Definition at line 375 of file kstandardaction.cpp.

376{
377 return KStandardAction::create(Up, recvr, slot, parent);
378}

References create(), and Up.

◆ whatsThis()

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

Trigger the What's This cursor.

Definition at line 603 of file kstandardaction.cpp.

604{
605 return KStandardAction::create(WhatsThis, recvr, slot, parent);
606}

References create(), and WhatsThis.

◆ zoom()

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

Popup a zoom dialog.

Definition at line 365 of file kstandardaction.cpp.

366{
367 return KStandardAction::create(Zoom, recvr, slot, parent);
368}

References create(), and Zoom.

◆ zoomIn()

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

Zoom in.

Definition at line 355 of file kstandardaction.cpp.

356{
357 return KStandardAction::create(ZoomIn, recvr, slot, parent);
358}

References create(), and ZoomIn.

◆ zoomOut()

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

Zoom out.

Definition at line 360 of file kstandardaction.cpp.

361{
362 return KStandardAction::create(ZoomOut, recvr, slot, parent);
363}

References create(), and ZoomOut.

Variable Documentation

◆ g_rgActionInfo

constexpr KStandardActionInfo KStandardAction::g_rgActionInfo[]
staticconstexpr

Definition at line 32 of file kstandardaction_p.h.

32 {
33 { New, KStandardShortcut::New, "file_new", QT_TRANSLATE_NOOP("KStandardActions", "&New"), QT_TRANSLATE_NOOP("KStandardActions", "Create new document"), "document-new" },
34 { Open, KStandardShortcut::Open, "file_open", QT_TRANSLATE_NOOP("KStandardActions", "&Open…"), QT_TRANSLATE_NOOP("KStandardActions", "Open an existing document"), "document-open" },
35 { OpenRecent, KStandardShortcut::AccelNone, "file_open_recent", QT_TRANSLATE_NOOP("KStandardActions", "Open &Recent"), QT_TRANSLATE_NOOP("KStandardActions", "Open a document which was recently opened"), "document-open-recent" },
36 { Save, KStandardShortcut::Save, "file_save", QT_TRANSLATE_NOOP("KStandardActions", "&Save"), QT_TRANSLATE_NOOP("KStandardActions", "Save document"), "document-save" },
37 { SaveAs, KStandardShortcut::SaveAs, "file_save_as", QT_TRANSLATE_NOOP("KStandardActions", "Save &As…"), QT_TRANSLATE_NOOP("KStandardActions", "Save document under a new name"), "document-save-as" },
38 { Revert, KStandardShortcut::Revert, "file_revert", QT_TRANSLATE_NOOP("KStandardActions", "Re&vert"), QT_TRANSLATE_NOOP("KStandardActions", "Revert unsaved changes made to document"), "document-revert" },
39 { Close, KStandardShortcut::Close, "file_close", QT_TRANSLATE_NOOP("KStandardActions", "&Close"), QT_TRANSLATE_NOOP("KStandardActions", "Close document"), "document-close" },
40 { Print, KStandardShortcut::Print, "file_print", QT_TRANSLATE_NOOP("KStandardActions", "&Print…"), QT_TRANSLATE_NOOP("KStandardActions", "Print document"), "document-print" },
41 { PrintPreview, KStandardShortcut::PrintPreview, "file_print_preview", QT_TRANSLATE_NOOP("KStandardActions", "Print Previe&w"), QT_TRANSLATE_NOOP("KStandardActions", "Show a print preview of document"), "document-print-preview" },
42 { Mail, KStandardShortcut::Mail, "file_mail", QT_TRANSLATE_NOOP("KStandardActions", "&Mail…"), QT_TRANSLATE_NOOP("KStandardActions", "Send document by mail"), "mail-send" },
43 { Quit, KStandardShortcut::Quit, "file_quit", QT_TRANSLATE_NOOP("KStandardActions", "&Quit"), QT_TRANSLATE_NOOP("KStandardActions", "Quit application"), "application-exit" },
44
45 { Undo, KStandardShortcut::Undo, "edit_undo", QT_TRANSLATE_NOOP("KStandardActions", "&Undo"), QT_TRANSLATE_NOOP("KStandardActions", "Undo last action"), "edit-undo" },
46 { Redo, KStandardShortcut::Redo, "edit_redo", QT_TRANSLATE_NOOP("KStandardActions", "Re&do"), QT_TRANSLATE_NOOP("KStandardActions", "Redo last undone action"), "edit-redo" },
47 { Cut, KStandardShortcut::Cut, "edit_cut", QT_TRANSLATE_NOOP("KStandardActions", "Cu&t"), QT_TRANSLATE_NOOP("KStandardActions", "Cut selection to clipboard"), "edit-cut" },
48 { Copy, KStandardShortcut::Copy, "edit_copy", QT_TRANSLATE_NOOP("KStandardActions", "&Copy"), QT_TRANSLATE_NOOP("KStandardActions", "Copy selection to clipboard"), "edit-copy" },
49 { Paste, KStandardShortcut::Paste, "edit_paste", QT_TRANSLATE_NOOP("KStandardActions", "&Paste"), QT_TRANSLATE_NOOP("KStandardActions", "Paste clipboard content"), "edit-paste" },
50 { Clear, KStandardShortcut::Clear, "edit_clear", QT_TRANSLATE_NOOP("KStandardActions", "C&lear"), {}, "edit-clear" },
51 { SelectAll, KStandardShortcut::SelectAll, "edit_select_all", QT_TRANSLATE_NOOP("KStandardActions", "Select &All"), {}, "edit-select-all" },
52 { Deselect, KStandardShortcut::Deselect, "edit_deselect", QT_TRANSLATE_NOOP("KStandardActions", "Dese&lect"), {}, "edit-select-none" },
53 { Find, KStandardShortcut::Find, "edit_find", QT_TRANSLATE_NOOP("KStandardActions", "&Find…"), {}, "edit-find" },
54 { FindNext, KStandardShortcut::FindNext, "edit_find_next", QT_TRANSLATE_NOOP("KStandardActions", "Find &Next"), {}, "go-down-search" },
55 { FindPrev, KStandardShortcut::FindPrev, "edit_find_prev", QT_TRANSLATE_NOOP("KStandardActions", "Find Pre&vious"), {}, "go-up-search" },
56 { Replace, KStandardShortcut::Replace, "edit_replace", QT_TRANSLATE_NOOP("KStandardActions", "&Replace…"), {}, "edit-find-replace" },
57
58 { ActualSize, KStandardShortcut::ActualSize, "view_actual_size", QT_TRANSLATE_NOOP("KStandardActions", "Zoom to &Actual Size"), QT_TRANSLATE_NOOP("KStandardActions", "View document at its actual size"), "zoom-original" },
59 { FitToPage, KStandardShortcut::FitToPage, "view_fit_to_page", QT_TRANSLATE_NOOP("KStandardActions", "&Fit to Page"), QT_TRANSLATE_NOOP("KStandardActions", "Zoom to fit page in window"), "zoom-fit-page" },
60 { FitToWidth, KStandardShortcut::FitToWidth, "view_fit_to_width", QT_TRANSLATE_NOOP("KStandardActions", "Fit to Page &Width"), QT_TRANSLATE_NOOP("KStandardActions", "Zoom to fit page width in window"), "zoom-fit-width" },
61 { FitToHeight, KStandardShortcut::FitToHeight, "view_fit_to_height", QT_TRANSLATE_NOOP("KStandardActions", "Fit to Page &Height"), QT_TRANSLATE_NOOP("KStandardActions", "Zoom to fit page height in window"), "zoom-fit-height" },
62 { ZoomIn, KStandardShortcut::ZoomIn, "view_zoom_in", QT_TRANSLATE_NOOP("KStandardActions", "Zoom &In"), {}, "zoom-in" },
63 { ZoomOut, KStandardShortcut::ZoomOut, "view_zoom_out", QT_TRANSLATE_NOOP("KStandardActions", "Zoom &Out"), {}, "zoom-out" },
64 { Zoom, KStandardShortcut::Zoom, "view_zoom", QT_TRANSLATE_NOOP("KStandardActions", "&Zoom…"), QT_TRANSLATE_NOOP("KStandardActions", "Select zoom level"), "zoom" },
65 { Redisplay, KStandardShortcut::Reload, "view_redisplay", QT_TRANSLATE_NOOP("KStandardActions", "&Refresh"), QT_TRANSLATE_NOOP("KStandardActions", "Refresh document"), "view-refresh" },
66
67 { Up, KStandardShortcut::Up, "go_up", QT_TRANSLATE_NOOP("KStandardActions", "&Up"), QT_TRANSLATE_NOOP("KStandardActions", "Go up"), "go-up" },
68 // The following three have special i18n() needs for sLabel
69 { Back, KStandardShortcut::Back, "go_back", {}, {}, "go-previous" },
70 { Forward, KStandardShortcut::Forward, "go_forward", {}, {}, "go-next" },
71 { Home, KStandardShortcut::Home, "go_home", {}, {}, "go-home" },
72 { Prior, KStandardShortcut::Prior, "go_previous", QT_TRANSLATE_NOOP("KStandardActions", "&Previous Page"), QT_TRANSLATE_NOOP("KStandardActions", "Go to previous page"), "go-previous-view-page" },
73 { Next, KStandardShortcut::Next, "go_next", QT_TRANSLATE_NOOP("KStandardActions", "&Next Page"), QT_TRANSLATE_NOOP("KStandardActions", "Go to next page"), "go-next-view-page" },
74 { Goto, KStandardShortcut::Goto, "go_goto", QT_TRANSLATE_NOOP("KStandardActions", "&Go To…"), {}, {} },
75 { GotoPage, KStandardShortcut::GotoPage, "go_goto_page", QT_TRANSLATE_NOOP("KStandardActions", "&Go to Page…"), {}, "go-jump" },
76 { GotoLine, KStandardShortcut::GotoLine, "go_goto_line", QT_TRANSLATE_NOOP("KStandardActions", "&Go to Line…"), {}, {} },
77 { FirstPage, KStandardShortcut::Begin, "go_first", QT_TRANSLATE_NOOP("KStandardActions", "&First Page"), QT_TRANSLATE_NOOP("KStandardActions", "Go to first page"), "go-first-view-page" },
78 { LastPage, KStandardShortcut::End, "go_last", QT_TRANSLATE_NOOP("KStandardActions", "&Last Page"), QT_TRANSLATE_NOOP("KStandardActions", "Go to last page"), "go-last-view-page" },
79 { DocumentBack, KStandardShortcut::DocumentBack, "go_document_back", QT_TRANSLATE_NOOP("KStandardActions", "&Back"), QT_TRANSLATE_NOOP("KStandardActions", "Go back in document"), "go-previous" },
80 { DocumentForward, KStandardShortcut::DocumentForward, "go_document_forward", QT_TRANSLATE_NOOP("KStandardActions", "&Forward"), QT_TRANSLATE_NOOP("KStandardActions", "Go forward in document"), "go-next" },
81
82 { AddBookmark, KStandardShortcut::AddBookmark, "bookmark_add", QT_TRANSLATE_NOOP("KStandardActions", "&Add Bookmark"), {}, "bookmark-new" },
83 { EditBookmarks, KStandardShortcut::EditBookmarks, "bookmark_edit", QT_TRANSLATE_NOOP("KStandardActions", "&Edit Bookmarks…"), {}, "bookmarks-organize" },
84
85 { Spelling, KStandardShortcut::Spelling, "tools_spelling", QT_TRANSLATE_NOOP("KStandardActions", "&Spelling…"), QT_TRANSLATE_NOOP("KStandardActions", "Check spelling in document"), "tools-check-spelling" },
86
87 { ShowMenubar, KStandardShortcut::ShowMenubar, "options_show_menubar", QT_TRANSLATE_NOOP("KStandardActions", "Show &Menubar"), QT_TRANSLATE_NOOP("KStandardActions", "Show or hide menubar"), "show-men" },
88 { ShowToolbar, KStandardShortcut::ShowToolbar, "options_show_toolbar", QT_TRANSLATE_NOOP("KStandardActions", "Show &Toolbar"), QT_TRANSLATE_NOOP("KStandardActions", "Show or hide toolbar"), {} },
89 { ShowStatusbar, KStandardShortcut::ShowStatusbar, "options_show_statusbar", QT_TRANSLATE_NOOP("KStandardActions", "Show St&atusbar"), QT_TRANSLATE_NOOP("KStandardActions", "Show or hide statusbar"), {} },
90 { FullScreen, KStandardShortcut::FullScreen, "fullscreen", QT_TRANSLATE_NOOP("KStandardActions", "F&ull Screen Mode"), {}, "view-fullscreen" },
91 { KeyBindings, KStandardShortcut::KeyBindings, "options_configure_keybinding", QT_TRANSLATE_NOOP("KStandardActions", "Configure Keyboard S&hortcuts…"), {}, "configure-shortcuts" },
92 { Preferences, KStandardShortcut::Preferences, "options_configure", QT_TRANSLATE_NOOP("KStandardActions", "&Configure %1…"), {}, "configure" },
93 { ConfigureToolbars, KStandardShortcut::ConfigureToolbars, "options_configure_toolbars", QT_TRANSLATE_NOOP("KStandardActions", "Configure Tool&bars…"), {}, "configure-toolbars" },
94 { ConfigureNotifications, KStandardShortcut::ConfigureNotifications, "options_configure_notifications", QT_TRANSLATE_NOOP("KStandardActions", "Configure &Notifications…"), {}, "preferences-desktop-notification" },
95
96 // the idea here is that Contents is used in menus, and Help in dialogs, so both share the same
97 // shortcut
98 { HelpContents, KStandardShortcut::Help, "help_contents", QT_TRANSLATE_NOOP("KStandardActions", "%1 &Handbook"), {}, "help-contents" },
99 { WhatsThis, KStandardShortcut::WhatsThis, "help_whats_this", QT_TRANSLATE_NOOP("KStandardActions", "What's &This?"), {}, "help-contextual" },
100 { ReportBug, KStandardShortcut::ReportBug, "help_report_bug", QT_TRANSLATE_NOOP("KStandardActions", "&Report Bug…"), {}, "tools-report-bug" },
101 { SwitchApplicationLanguage, KStandardShortcut::SwitchApplicationLanguage, "switch_application_language", QT_TRANSLATE_NOOP("KStandardActions", "Configure &Language…"), {}, "preferences-desktop-locale" },
102 { AboutApp, KStandardShortcut::AccelNone, "help_about_app", QT_TRANSLATE_NOOP("KStandardActions", "&About %1"), {}, nullptr },
103 { AboutKDE, KStandardShortcut::AccelNone, "help_about_kde", QT_TRANSLATE_NOOP("KStandardActions", "About &KDE"), {}, "kde" },
104 { ActionNone, KStandardShortcut::AccelNone, {}, {}, {}, {} },
105 };