KXmlGui
kactioncollection.h
179 void writeSettings(KConfigGroup *config = nullptr, bool writeDefaults = false, QAction *oneAction = nullptr) const;
226 * Returns the list of QActions without an QAction::actionGroup() which belong to this action collection.
288 /// Overridden to perform connections when someone wants to know whether an action was highlighted or triggered
374 QAction *addAction(KStandardAction::StandardAction actionType, const QObject *receiver = nullptr, const char *member = nullptr);
396 QAction *addAction(KStandardAction::StandardAction actionType, const QString &name, const QObject *receiver = nullptr, const char *member = nullptr);
399 * This is the same as addAction(KStandardAction::StandardAction actionType, const QString &name, const QObject *receiver, const char *member) using
408 * @see addAction(KStandardAction::StandardAction, const QString &, const QObject *, const char *)
412 inline QAction *addAction(KStandardAction::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
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)
426 * This is the same as addAction(KStandardAction::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
437 inline QAction *addAction(KStandardActions::StandardAction actionType, const QString &name, const Receiver *receiver, Func slot)
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)
446 QAction *action = KStandardAction::create(static_cast<KStandardAction::StandardAction>(actionType), receiver, slot, nullptr);
474 inline QAction *addAction(KStandardActions::StandardAction actionType, const Receiver *receiver, Func slot)
477 inline typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *
484 QAction *action = KStandardAction::create(static_cast<KStandardAction::StandardAction>(actionType), receiver, slot, this);
528 QAction *addAction(const QString &name, const QObject *receiver = nullptr, const char *member = nullptr);
531 * Creates a new action under the given name, adds it to the collection and connects the action's triggered(bool)
562 * This is the same as add(const QString &name, const QObject *receiver, const char *member) using
589 * This is the same as addAction(const QString &name, const QObject *receiver, const char *member) using
604 inline typename std::enable_if<!std::is_convertible<Func, const char *>::value, QAction>::type *
649 Q_INVOKABLE static void setDefaultShortcuts(QAction *action, const QList<QKeySequence> &shortcuts);
663 * @param configurable set to true if the shortcuts of the given action may be configured by the user, otherwise false.
669 KXMLGUI_NO_EXPORT explicit KActionCollection(const KXMLGUIClient *parent); // used by KXMLGUIClient
Q_INVOKABLE QAction * addAction(const QString &name, QAction *action)
Add an action under the given name to the collection.
Definition kactioncollection.cpp:292
void addActions(const QList< QAction * > &actions)
Adds a list of actions to the collection.
Definition kactioncollection.cpp:389
void addAssociatedWidget(QWidget *widget)
Associate all actions in this collection to the given widget, including any actions added after this ...
Definition kactioncollection.cpp:830
int count() const
Returns the number of actions in the collection.
Definition kactioncollection.cpp:209
QList< QWidget * > associatedWidgets() const
Return a list of all associated widgets.
Definition kactioncollection.cpp:873
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,...
Definition kactioncollection.h:412
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...
Definition kactioncollection.h:601
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...
Definition kactioncollection.h:474
void actionHovered(QAction *action)
Indicates that action was hovered.
QString componentDisplayName() const
The display name for the associated component.
Definition kactioncollection.cpp:249
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...
Definition kactioncollection.h:551
void clear()
Clears the entire action collection, deleting all actions.
Definition kactioncollection.cpp:188
void importGlobalShortcuts(KConfigGroup *config)
Import from config all configurable global key associations.
Definition kactioncollection.cpp:510
void exportGlobalShortcuts(KConfigGroup *config, bool writeDefaults=false) const
Export the current configurable global key associations to config.
Definition kactioncollection.cpp:567
void setConfigGroup(const QString &group)
Sets group as the KConfig group with which settings will be loaded and saved.
Definition kactioncollection.cpp:495
void setComponentName(const QString &componentName)
Set the componentName associated with this action collection.
Definition kactioncollection.cpp:219
void clearAssociatedWidgets()
Clear all associated widgets and remove the actions from those widgets.
Definition kactioncollection.cpp:878
void associateWidget(QWidget *widget) const
Associate all actions in this collection to the given widget.
Definition kactioncollection.cpp:821
const KXMLGUIClient * parentGUIClient() const
The parent KXMLGUIClient, or null if not available.
Definition kactioncollection.cpp:260
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...
Definition kactioncollection.h:575
const QList< QAction * > actionsWithoutGroup() const
Returns the list of QActions without an QAction::actionGroup() which belong to this action collection...
Definition kactioncollection.cpp:270
QAction * takeAction(QAction *action)
Removes an action from the collection.
Definition kactioncollection.cpp:401
bool isEmpty() const
Returns whether the action collection is empty or not.
Definition kactioncollection.cpp:214
KActionCollection(QObject *parent, const QString &cName=QString())
Constructor.
Definition kactioncollection.cpp:164
const QList< QActionGroup * > actionGroups() const
Returns the list of all QActionGroups associated with actions in this action collection.
Definition kactioncollection.cpp:281
void changed()
Emitted when an action has been inserted into, or removed from, this action collection.
void writeSettings(KConfigGroup *config=nullptr, bool writeDefaults=false, QAction *oneAction=nullptr) const
Write the current configurable key associations to config.
Definition kactioncollection.cpp:687
void removeAction(QAction *action)
Removes an action from the collection and deletes it.
Definition kactioncollection.cpp:396
void inserted(QAction *action)
Indicates that action was inserted into this action collection.
QString componentName() const
The component name with which this class is associated.
Definition kactioncollection.cpp:239
static const QList< KActionCollection * > & allCollections()
Access the list of all action collections in existence for this app.
Definition kactioncollection.cpp:816
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,...
Definition kactioncollection.h:437
void setComponentDisplayName(const QString &displayName)
Set the component display name associated with this action collection.
Definition kactioncollection.cpp:244
void removeAssociatedWidget(QWidget *widget)
Remove an association between all actions in this collection and the given widget,...
Definition kactioncollection.cpp:842
void readSettings(KConfigGroup *config=nullptr)
Read all key associations from config.
Definition kactioncollection.cpp:538
QList< QAction * > actions() const
Returns the list of QActions which belong to this action collection.
Definition kactioncollection.cpp:265
void setConfigGlobal(bool global)
Set whether this action collection's configuration should be global to KDE ( true ),...
Definition kactioncollection.cpp:505
QAction * action(int index) const
Return the QAction* at position index in the action collection.
Definition kactioncollection.cpp:203
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,...
Definition kxmlguiclient.h:40
QAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
StandardAction
StandardAction
void triggered(bool checked)
QObject(QObject *parent)
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
virtual void connectNotify(const QMetaMethod &signal)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:54:16 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:54:16 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.