KXmlGui

kactioncollection.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 1999 Reginald Stadlbauer <reggie@kde.org>
4 SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
5 SPDX-FileCopyrightText: 2000 Nicolas Hadacek <haadcek@kde.org>
6 SPDX-FileCopyrightText: 2000 Kurt Granroth <granroth@kde.org>
7 SPDX-FileCopyrightText: 2000 Michael Koch <koch@kde.org>
8 SPDX-FileCopyrightText: 2001 Holger Freyther <freyther@kde.org>
9 SPDX-FileCopyrightText: 2002 Ellis Whitehead <ellis@kde.org>
10 SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <rodda@kde.org>
11
12 SPDX-License-Identifier: LGPL-2.0-only
13*/
14
15#ifndef KACTIONCOLLECTION_H
16#define KACTIONCOLLECTION_H
17
18#include <KStandardAction>
19#include <KStandardActions>
20#include <kxmlgui_export.h>
21
22#include <QAction>
23#include <QObject>
24#include <memory>
25
26class KXMLGUIClient;
27class KConfigGroup;
28class QActionGroup;
29class QString;
30
31/**
32 * @class KActionCollection kactioncollection.h KActionCollection
33 *
34 * \short A container for a set of QAction objects.
35 *
36 * KActionCollection manages a set of QAction objects. It
37 * allows them to be grouped for organized presentation of configuration to the user,
38 * saving + loading of configuration, and optionally for automatic plugging into
39 * specified widget(s).
40 *
41 * Additionally, KActionCollection provides several convenience functions for locating
42 * named actions, and actions grouped by QActionGroup.
43 *
44 * \note If you create your own action collection and need to assign shortcuts
45 * to the actions within, you have to call associateWidget() or
46 * addAssociatedWidget() to have them working.
47 */
48class KXMLGUI_EXPORT KActionCollection : public QObject
49{
50 friend class KXMLGUIClient;
51
52 Q_OBJECT
53
54 Q_PROPERTY(QString configGroup READ configGroup WRITE setConfigGroup)
55 Q_PROPERTY(bool configIsGlobal READ configIsGlobal WRITE setConfigGlobal)
56
57public:
58 /**
59 * Constructor. Allows specification of a component name other than the default
60 * application name, where needed (remember to call setComponentDisplayName() too).
61 */
62 explicit KActionCollection(QObject *parent, const QString &cName = QString());
63
64 /**
65 * Destructor.
66 */
67 ~KActionCollection() override;
68
69 /**
70 * Access the list of all action collections in existence for this app
71 */
72 static const QList<KActionCollection *> &allCollections();
73
74 /**
75 * Clears the entire action collection, deleting all actions.
76 */
77 void clear();
78
79 /**
80 * Associate all actions in this collection to the given @p widget.
81 * Unlike addAssociatedWidget(), this method only adds all current actions
82 * in the collection to the given widget. Any action added after this call
83 * will not be added to the given widget automatically.
84 * So this is just a shortcut for a foreach loop and a widget->addAction call.
85 */
86 void associateWidget(QWidget *widget) const;
87
88 /**
89 * Associate all actions in this collection to the given @p widget, including any actions
90 * added after this association is made.
91 *
92 * This does not change the action's shortcut context, so if you need to have the actions only
93 * trigger when the widget has focus, you'll need to set the shortcut context on each action
94 * to Qt::WidgetShortcut (or better still, Qt::WidgetWithChildrenShortcut with Qt 4.4+)
95 */
96 void addAssociatedWidget(QWidget *widget);
97
98 /**
99 * Remove an association between all actions in this collection and the given @p widget, i.e.
100 * remove those actions from the widget, and stop associating newly added actions as well.
101 */
102 void removeAssociatedWidget(QWidget *widget);
103
104 /**
105 * Return a list of all associated widgets.
106 */
107 QList<QWidget *> associatedWidgets() const;
108
109 /**
110 * Clear all associated widgets and remove the actions from those widgets.
111 */
112 void clearAssociatedWidgets();
113
114 /**
115 * Returns the KConfig group with which settings will be loaded and saved.
116 */
117 QString configGroup() const;
118
119 /**
120 * Returns whether this action collection's configuration should be global to KDE ( @c true ),
121 * or specific to the application ( @c false ).
122 */
123 bool configIsGlobal() const;
124
125 /**
126 * Sets @p group as the KConfig group with which settings will be loaded and saved.
127 */
128 void setConfigGroup(const QString &group);
129
130 /**
131 * Set whether this action collection's configuration should be global to KDE ( @c true ),
132 * or specific to the application ( @c false ).
133 */
134 void setConfigGlobal(bool global);
135
136 /**
137 * Read all key associations from @p config.
138 *
139 * If @p config is zero, read all key associations from the
140 * application's configuration file KSharedConfig::openConfig(),
141 * in the group set by setConfigGroup().
142 */
143 void readSettings(KConfigGroup *config = nullptr);
144
145 /**
146 * Import from @p config all configurable global key associations.
147 *
148 * \since 4.1
149 *
150 * \param config Config object to read from
151 */
152 void importGlobalShortcuts(KConfigGroup *config);
153
154 /**
155 * Export the current configurable global key associations to @p config.
156 *
157 * \since 4.1
158 *
159 * \param config Config object to save to
160 * \param writeDefaults set to true to write settings which are already at defaults.
161 */
162 void exportGlobalShortcuts(KConfigGroup *config, bool writeDefaults = false) const;
163
164 /**
165 * Write the current configurable key associations to @p config. What the
166 * function does if @p config is zero depends. If this action collection
167 * belongs to a KXMLGUIClient the setting are saved to the kxmlgui
168 * definition file. If not the settings are written to the applications
169 * config file.
170 *
171 * \note @p oneAction and @p writeDefaults have no meaning for the kxmlgui
172 * configuration file.
173 *
174 * \param config Config object to save to, or null (see above)
175 * \param writeDefaults set to true to write settings which are already at defaults.
176 * \param oneAction pass an action here if you just want to save the values for one action, eg.
177 * if you know that action is the only one which has changed.
178 */
179 void writeSettings(KConfigGroup *config = nullptr, bool writeDefaults = false, QAction *oneAction = nullptr) const;
180
181 /**
182 * Returns the number of actions in the collection.
183 *
184 * This is equivalent to actions().count().
185 */
186 int count() const;
187
188 /**
189 * Returns whether the action collection is empty or not.
190 */
191 bool isEmpty() const;
192
193 /**
194 * Return the QAction* at position @p index in the action collection.
195 *
196 * This is equivalent to actions().value(index);
197 */
198 QAction *action(int index) const;
199
200 /**
201 * Get the action with the given \p name from the action collection.
202 *
203 * This won't return the action for the menus defined using a "<Menu>" tag
204 * in XMLGUI files (e.g. "<Menu name="menuId">" in "applicationNameui.rc").
205 * To access menu actions defined like this, use e.g.
206 * \code
207 * qobject_cast<QMenu *>(guiFactory()->container("menuId", this));
208 * \endcode
209 * after having called setupGUI() or createGUI().
210 *
211 * @param name Name of the QAction
212 * @return A pointer to the QAction in the collection which matches the parameters or
213 * null if nothing matches.
214 */
215 Q_INVOKABLE QAction *action(const QString &name) const;
216
217 /**
218 * Returns the list of QActions which belong to this action collection.
219 *
220 * The list is guaranteed to be in the same order the action were put into
221 * the collection.
222 */
223 QList<QAction *> actions() const;
224
225 /**
226 * Returns the list of QActions without an QAction::actionGroup() which belong to this action collection.
227 */
228 const QList<QAction *> actionsWithoutGroup() const;
229
230 /**
231 * Returns the list of all QActionGroups associated with actions in this action collection.
232 */
233 const QList<QActionGroup *> actionGroups() const;
234
235 /**
236 * Set the @p componentName associated with this action collection.
237 *
238 * \warning Don't call this method on a KActionCollection that contains
239 * actions. This is not supported.
240 *
241 * \param componentData the name which is to be associated with this action collection,
242 * or QString() to indicate the app name. This is used to load/save settings into XML files.
243 * KXMLGUIClient::setComponentName takes care of calling this.
244 */
245 void setComponentName(const QString &componentName);
246
247 /** The component name with which this class is associated. */
248 QString componentName() const;
249
250 /**
251 * Set the component display name associated with this action collection.
252 * (e.g. for the toolbar editor)
253 * KXMLGUIClient::setComponentName takes care of calling this.
254 */
255 void setComponentDisplayName(const QString &displayName);
256
257 /** The display name for the associated component. */
258 QString componentDisplayName() const;
259
260 /**
261 * The parent KXMLGUIClient, or null if not available.
262 */
263 const KXMLGUIClient *parentGUIClient() const;
264
266 /**
267 * Indicates that @p action was inserted into this action collection.
268 */
269 void inserted(QAction *action);
270
271 /**
272 * Emitted when an action has been inserted into, or removed from, this action collection.
273 * @since 5.66
274 */
275 void changed();
276
277 /**
278 * Indicates that @p action was hovered.
279 */
280 void actionHovered(QAction *action);
281
282 /**
283 * Indicates that @p action was triggered
284 */
286
287protected:
288 /// Overridden to perform connections when someone wants to know whether an action was highlighted or triggered
289 void connectNotify(const QMetaMethod &signal) override;
290
291protected Q_SLOTS:
292 virtual void slotActionTriggered();
293
294private Q_SLOTS:
295 KXMLGUI_NO_EXPORT void slotActionHovered();
296
297public:
298 /**
299 * Add an action under the given name to the collection.
300 *
301 * Inserting an action that was previously inserted under a different name will replace the
302 * old entry, i.e. the action will not be available under the old name anymore but only under
303 * the new one.
304 *
305 * Inserting an action under a name that is already used for another action will replace
306 * the other action in the collection (but will not delete it).
307 *
308 * If KAuthorized::authorizeAction() reports that the action is not
309 * authorized, it will be disabled and hidden.
310 *
311 * The ownership of the action object is not transferred.
312 * If the action is destroyed it will be removed automatically from the KActionCollection.
313 *
314 * @param name The name by which the action be retrieved again from the collection.
315 * @param action The action to add.
316 * @return the same as the action given as parameter. This is just for convenience
317 * (chaining calls) and consistency with the other addAction methods, you can also
318 * simply ignore the return value.
319 */
320 Q_INVOKABLE QAction *addAction(const QString &name, QAction *action);
321
322 /**
323 * Adds a list of actions to the collection.
324 *
325 * The objectName of the actions is used as their internal name in the collection.
326 *
327 * The ownership of the action objects is not transferred.
328 * If the action is destroyed it will be removed automatically from the KActionCollection.
329 *
330 * Uses addAction(const QString&, QAction*).
331 *
332 * @param actions the list of the actions to add.
333 *
334 * @see addAction()
335 * @since 5.0
336 */
337 void addActions(const QList<QAction *> &actions);
338
339 /**
340 * Removes an action from the collection and deletes it.
341 * @param action The action to remove.
342 */
343 void removeAction(QAction *action);
344
345 /**
346 * Removes an action from the collection.
347 *
348 * The ownership of the action object is not changed.
349 *
350 * @param action the action to remove.
351 */
352 QAction *takeAction(QAction *action);
353
354 /**
355 * Creates a new standard action, adds it to the collection and connects the
356 * action's triggered(bool) signal to the specified receiver/member. The
357 * newly created action is also returned.
358 *
359 * @note Using KStandardAction::OpenRecent will cause a different signal than
360 * triggered(bool) to be used, see KStandardAction for more information.
361 *
362 * The action can be retrieved later from the collection by its standard name as per
363 * KStandardAction::stdName.
364 *
365 * The KActionCollection takes ownership of the action object.
366 *
367 * @param actionType The standard action type of the action to create.
368 * @param receiver The QObject to connect the triggered(bool) signal to. Leave nullptr if no
369 * connection is desired.
370 * @param member The SLOT to connect the triggered(bool) signal to. Leave nullptr if no
371 * connection is desired.
372 * @return new action of the given type ActionType.
373 */
374 QAction *addAction(KStandardAction::StandardAction actionType, const QObject *receiver = nullptr, const char *member = nullptr);
375
376 /**
377 * Creates a new standard action, adds to the collection under the given name
378 * and connects the action's triggered(bool) signal to the specified
379 * receiver/member. The newly created action is also returned.
380 *
381 * @note Using KStandardAction::OpenRecent will cause a different signal than
382 * triggered(bool) to be used, see KStandardAction for more information.
383 *
384 * The action can be retrieved later from the collection by the specified name.
385 *
386 * The KActionCollection takes ownership of the action object.
387 *
388 * @param actionType The standard action type of the action to create.
389 * @param name The name by which the action be retrieved again from the collection.
390 * @param receiver The QObject to connect the triggered(bool) signal to. Leave nullptr if no
391 * connection is desired.
392 * @param member The SLOT to connect the triggered(bool) signal to. Leave nullptr if no
393 * connection is desired.
394 * @return new action of the given type ActionType.
395 */
396 QAction *addAction(KStandardAction::StandardAction actionType, const QString &name, const QObject *receiver = nullptr, const char *member = nullptr);
397
398/**
399 * This is the same as addAction(KStandardAction::StandardAction actionType, const QString &name, const QObject *receiver, const char *member) using
400 * new style connect syntax.
401 *
402 * @param actionType The standard action type of the action to create.
403 * @param name The name by which the action be retrieved again from the collection.
404 * @param receiver The QObject to connect the triggered(bool) signal to.
405 * @param slot The slot or lambda to connect the triggered(bool) signal to.
406 * @return new action of the given type ActionType.
407 *
408 * @see addAction(KStandardAction::StandardAction, const QString &, const QObject *, const char *)
409 * @since 5.80
410 */
411#ifdef K_DOXYGEN
412 inline QAction *addAction(KStandardAction::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
413#else
414 template<class Receiver, class Func>
415 inline typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *
416 addAction(KStandardAction::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
417#endif
418 {
419 QAction *action = KStandardAction::create(actionType, receiver, slot, nullptr);
420 action->setParent(this);
421 action->setObjectName(name);
422 return addAction(name, action);
423 }
424
425 /**
426 * This is the same as addAction(KStandardAction::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
427 * but using KStandardActions from KConfigGui.
428 *
429 * @param actionType The standard action type of the action to create.
430 * @param name The name by which the action be retrieved again from the collection.
431 * @param receiver The QObject to connect the triggered(bool) signal to.
432 * @param slot The slot or lambda to connect the triggered(bool) signal to.
433 * @return new action of the given type ActionType.
434 * @since 6.3
435 */
436#ifdef K_DOXYGEN
437 inline QAction *addAction(KStandardActions::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
438#else
439 template<class Receiver, class Func>
440 inline typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *
441 addAction(KStandardActions::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
442#endif
443 {
444 // Use implementation from KConfigWidgets instead of KConfigGui
445 // as it provides tighter integration with QtWidgets applications.
446 QAction *action = KStandardAction::create(static_cast<KStandardAction::StandardAction>(actionType), receiver, slot, nullptr);
447 action->setParent(this);
448 action->setObjectName(name);
449 return addAction(name, action);
450 }
451
452 /**
453 * Creates a new standard action, adds it to the collection and connects the
454 * action's triggered(bool) signal to the specified receiver/member. The
455 * newly created action is also returned.
456 *
457 * @note Using KStandardAction::OpenRecent will cause a different signal than
458 * triggered(bool) to be used, see KStandardAction for more information.
459 *
460 * The action can be retrieved later from the collection by its standard name as per
461 * KStandardAction::stdName.
462 *
463 * The KActionCollection takes ownership of the action object.
464 *
465 * @param actionType The standard action type of the action to create.
466 * @param receiver The QObject to connect the triggered(bool) signal to. Leave nullptr if no
467 * connection is desired.
468 * @param slot The slot or lambda to connect the triggered(bool) signal to.
469 * @return new action of the given type ActionType.
470 *
471 * @since 6.3
472 */
473#ifdef K_DOXYGEN
474 inline QAction *addAction(KStandardActions::StandardAction actionType, const Receiver *receiver, Func slot)
475#else
476 template<class Receiver, class Func>
477 inline typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *
478 addAction(KStandardActions::StandardAction actionType, const Receiver *receiver, Func slot)
479#endif
480 {
481 // Use implementation from KConfigWidgets instead of KConfigGui
482 // as it provides tighter integration with QtWidgets applications.
483 // KStandardAction automatically adds it to the collection.
484 QAction *action = KStandardAction::create(static_cast<KStandardAction::StandardAction>(actionType), receiver, slot, this);
485 return action;
486 }
487
488 /**
489 * Creates a new action under the given name to the collection and connects
490 * the action's triggered(bool) signal to the specified receiver/member. The
491 * newly created action is returned.
492 *
493 * NOTE: KDE prior to 4.2 used the triggered() signal instead of the triggered(bool)
494 * signal.
495 *
496 * Inserting an action that was previously inserted under a different name will replace the
497 * old entry, i.e. the action will not be available under the old name anymore but only under
498 * the new one.
499 *
500 * Inserting an action under a name that is already used for another action will replace
501 * the other action in the collection.
502 *
503 * The KActionCollection takes ownership of the action object.
504 *
505 * @param name The name by which the action be retrieved again from the collection.
506 * @param receiver The QObject to connect the triggered(bool) signal to. Leave nullptr if no
507 * connection is desired.
508 * @param member The SLOT to connect the triggered(bool) signal to. Leave nullptr if no
509 * connection is desired.
510 * @return new action of the given type ActionType.
511 */
512 QAction *addAction(const QString &name, const QObject *receiver = nullptr, const char *member = nullptr);
513
514 /**
515 * Creates a new action under the given name, adds it to the collection and connects the action's triggered(bool)
516 * signal to the specified receiver/member. The receiver slot may accept either a bool or no
517 * parameters at all (i.e. slotTriggered(bool) or slotTriggered() ).
518 * The type of the action is specified by the template parameter ActionType.
519 *
520 * NOTE: KDE prior to 4.2 connected the triggered() signal instead of the triggered(bool)
521 * signal.
522 *
523 * The KActionCollection takes ownership of the action object.
524 *
525 * @param name The internal name of the action (e.g. "file-open").
526 * @param receiver The QObject to connect the triggered(bool) signal to. Leave nullptr if no
527 * connection is desired.
528 * @param member The SLOT to connect the triggered(bool) signal to. Leave nullptr if no
529 * connection is desired.
530 * @return new action of the given type ActionType.
531 *
532 * @see addAction()
533 */
534 template<class ActionType>
535 ActionType *add(const QString &name, const QObject *receiver = nullptr, const char *member = nullptr)
536 {
537 ActionType *a = new ActionType(this);
538 if (receiver && member) {
539 connect(a, SIGNAL(triggered(bool)), receiver, member);
540 }
541 addAction(name, a);
542 return a;
543 }
544
545/**
546 * This is the same as add(const QString &name, const QObject *receiver, const char *member) using
547 * new style connect syntax.
548 *
549 * @param name The internal name of the action (e.g. "file-open").
550 * @param receiver The QObject to connect the triggered(bool) signal to.
551 * @param slot The slot or lambda to connect the triggered(bool) signal to.
552 * @return new action of the given type ActionType.
553 *
554 * @see add(const QString &, const QObject *, const char *)
555 * @since 5.28
556 */
557#ifdef K_DOXYGEN
558 template<class ActionType>
559 inline ActionType *add(const QString &name, const Receiver *receiver, Func slot)
560#else
561 template<class ActionType, class Receiver, class Func>
562 inline typename std::enable_if<!std::is_convertible<Func, const char *>::value, ActionType>::type *
563 add(const QString &name, const Receiver *receiver, Func slot)
564#endif
565 {
566 ActionType *a = new ActionType(this);
567 connect(a, &QAction::triggered, receiver, slot);
568 addAction(name, a);
569 return a;
570 }
571
572/**
573 * This is the same as addAction(const QString &name, const QObject *receiver, const char *member) using
574 * new style connect syntax.
575 *
576 * @param name The internal name of the action (e.g. "file-open").
577 * @param receiver The QObject to connect the triggered(bool) signal to.
578 * @param slot The slot or lambda to connect the triggered(bool) signal to.
579 * @return new action of the given type ActionType.
580 *
581 * @see addAction(const QString &, const QObject *, const char *)
582 * @since 5.28
583 */
584#ifdef K_DOXYGEN
585 inline QAction *addAction(const QString &name, const Receiver *receiver, Func slot)
586#else
587 template<class Receiver, class Func>
588 inline typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *
589 addAction(const QString &name, const Receiver *receiver, Func slot)
590#endif
591 {
592 return add<QAction>(name, receiver, slot);
593 }
594
595 /**
596 * Get the default primary shortcut for the given action.
597 *
598 * @param action the action for which the default primary shortcut should be returned.
599 * @return the default primary shortcut of the given action
600 * @since 5.0
601 */
602 static QKeySequence defaultShortcut(QAction *action);
603
604 /**
605 * Get the default shortcuts for the given action.
606 *
607 * @param action the action for which the default shortcuts should be returned.
608 * @return the default shortcuts of the given action
609 * @since 5.0
610 */
611 static QList<QKeySequence> defaultShortcuts(QAction *action);
612
613 /**
614 * Set the default shortcut for the given action.
615 * Since 5.2, this also calls action->setShortcut(shortcut), i.e. the default shortcut is
616 * made active initially.
617 *
618 * @param action the action for which the default shortcut should be set.
619 * @param shortcut the shortcut to use for the given action in its specified shortcutContext()
620 * @since 5.0
621 */
622 static void setDefaultShortcut(QAction *action, const QKeySequence &shortcut);
623
624 /**
625 * Set the default shortcuts for the given action.
626 * Since 5.2, this also calls action->setShortcuts(shortcuts), i.e. the default shortcut is
627 * made active initially.
628 *
629 * @param action the action for which the default shortcut should be set.
630 * @param shortcuts the shortcuts to use for the given action in its specified shortcutContext()
631 * @since 5.0
632 */
633 Q_INVOKABLE static void setDefaultShortcuts(QAction *action, const QList<QKeySequence> &shortcuts);
634
635 /**
636 * Returns true if the given action's shortcuts may be configured by the user.
637 *
638 * @param action the action for the hint should be verified.
639 * @since 5.0
640 */
641 static bool isShortcutsConfigurable(QAction *action);
642
643 /**
644 * Indicate whether the user may configure the action's shortcuts.
645 *
646 * @param action the action for the hint should be verified.
647 * @param configurable set to true if the shortcuts of the given action may be configured by the user, otherwise false.
648 * @since 5.0
649 */
650 static void setShortcutsConfigurable(QAction *action, bool configurable);
651
652private:
653 KXMLGUI_NO_EXPORT explicit KActionCollection(const KXMLGUIClient *parent); // used by KXMLGUIClient
654
655 friend class KActionCollectionPrivate;
656 std::unique_ptr<class KActionCollectionPrivate> const d;
657};
658
659#endif
A container for a set of QAction objects.
QAction * addAction(KStandardAction::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
This is the same as addAction(KStandardAction::StandardAction actionType, const QString &name,...
QAction * addAction(const QString &name, const Receiver *receiver, Func slot)
This is the same as addAction(const QString &name, const QObject *receiver, const char *member) using...
QAction * addAction(KStandardActions::StandardAction actionType, const Receiver *receiver, Func slot)
Creates a new standard action, adds it to the collection and connects the action's triggered(bool) si...
void actionHovered(QAction *action)
Indicates that action was hovered.
ActionType * add(const QString &name, const QObject *receiver=nullptr, const char *member=nullptr)
Creates a new action under the given name, adds it to the collection and connects the action's trigge...
ActionType * add(const QString &name, const Receiver *receiver, Func slot)
This is the same as add(const QString &name, const QObject *receiver, const char *member) using new s...
void changed()
Emitted when an action has been inserted into, or removed from, this action collection.
void inserted(QAction *action)
Indicates that action was inserted into this action collection.
QAction * addAction(KStandardActions::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
This is the same as addAction(KStandardAction::StandardAction actionType, const QString &name,...
void actionTriggered(QAction *action)
Indicates that action was triggered.
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
QAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
void triggered(bool checked)
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
virtual void connectNotify(const QMetaMethod &signal)
void setObjectName(QAnyStringView name)
void setParent(QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:02:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.