KDEUI
kactioncollection.cpp
Go to the documentation of this file.
243 kError() << "Changing action name from " << objectName << " to " << indexName << "\nignored because of active global shortcut.";
337KAction *KActionCollection::addAction(KStandardAction::StandardAction actionType, const QObject *receiver, const char *member)
343KAction *KActionCollection::addAction(KStandardAction::StandardAction actionType, const QString &name,
346 // pass 0 as parent, because if the parent is a KActionCollection KStandardAction::create automatically
358KAction *KActionCollection::addAction(const QString &name, const QObject *receiver, const char *member)
404 kaction->setGlobalShortcut( KShortcut(entry), KAction::ActiveShortcut, KAction::NoAutoloading );
406 kaction->setGlobalShortcut( kaction->shortcut(KAction::DefaultShortcut), KAction::ActiveShortcut, KAction::NoAutoloading );
470 bool bSameAsDefault = (kaction->globalShortcut() == kaction->globalShortcut(KAction::DefaultShortcut));
531 kError() << "Skipped writing shortcut for action " << actionName << "(" << kaction->text() << ")!";
563void KActionCollection::writeSettings( KConfigGroup* config, bool writeAll, QAction* oneAction ) const
714 connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(_k_associatedWidgetDestroyed(QObject*)));
724 disconnect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(_k_associatedWidgetDestroyed(QObject*)));
QAction * addAction(const QString &name, QAction *action)
Add an action under the given name to the collection.
Definition: kactioncollection.cpp:217
virtual QT_MOC_COMPAT void slotActionHighlighted()
Definition: kactioncollection.cpp:643
void addAssociatedWidget(QWidget *widget)
Associate all actions in this collection to the given widget, including any actions added after this ...
Definition: kactioncollection.cpp:708
int count() const
Returns the number of actions in the collection.
Definition: kactioncollection.cpp:147
QList< QWidget * > associatedWidgets() const
Return a list of all associated widgets.
Definition: kactioncollection.cpp:761
void actionHovered(QAction *action)
Indicates that action was hovered.
void readSettings(KConfigGroup *config=0)
Read all key associations from config.
Definition: kactioncollection.cpp:413
virtual void connectNotify(const char *signal)
Overridden to perform connections when someone wants to know whether an action was highlighted or tri...
Definition: kactioncollection.cpp:671
void writeSettings(KConfigGroup *config=0, bool writeDefaults=false, QAction *oneAction=0) const
Write the current configurable key associations to config.
Definition: kactioncollection.cpp:563
void clear()
Clears the entire action collection, deleting all actions.
Definition: kactioncollection.cpp:124
void importGlobalShortcuts(KConfigGroup *config)
Import from config all configurable global key associations.
Definition: kactioncollection.cpp:386
QT_MOC_COMPAT void actionHighlighted(QAction *action)
Indicates that action was highlighted (hovered over).
void exportGlobalShortcuts(KConfigGroup *config, bool writeDefaults=false) const
Export the current configurable global key associations to config.
Definition: kactioncollection.cpp:444
void setConfigGroup(const QString &group)
Sets group as the KConfig group with which settings will be loaded and saved.
Definition: kactioncollection.cpp:371
void clearAssociatedWidgets()
Clear all associated widgets and remove the actions from those widgets.
Definition: kactioncollection.cpp:766
KComponentData componentData() const
The KComponentData with which this class is associated.
Definition: kactioncollection.cpp:176
void associateWidget(QWidget *widget) const
Associate all actions in this collection to the given widget.
Definition: kactioncollection.cpp:700
const KXMLGUIClient * parentGUIClient() const
The parent KXMLGUIClient, or null if not available.
Definition: kactioncollection.cpp:181
const QList< QAction * > actionsWithoutGroup() const
Returns the list of KActions without an QAction::actionGroup() which belong to this action collection...
Definition: kactioncollection.cpp:191
QAction * takeAction(QAction *action)
Removes an action from the collection.
Definition: kactioncollection.cpp:321
bool isEmpty() const
Returns whether the action collection is empty or not.
Definition: kactioncollection.cpp:152
virtual void slotActionTriggered()
Definition: kactioncollection.cpp:636
const QList< QActionGroup * > actionGroups() const
Returns the list of all QActionGroups associated with actions in this action collection.
Definition: kactioncollection.cpp:200
QT_MOC_COMPAT void removed(QAction *action)
Indicates that action was removed from this action collection.
void removeAction(QAction *action)
Removes an action from the collection and deletes it.
Definition: kactioncollection.cpp:316
void inserted(QAction *action)
Indicates that action was inserted into this action collection.
KActionCollection(QObject *parent, const KComponentData &cData=KComponentData())
Constructor.
Definition: kactioncollection.cpp:96
static const QList< KActionCollection * > & allCollections()
Access the list of all action collections in existence for this app.
Definition: kactioncollection.cpp:695
void setComponentData(const KComponentData &componentData)
Set the componentData associated with this action collection.
Definition: kactioncollection.cpp:157
void removeAssociatedWidget(QWidget *widget)
Remove an association between all actions in this collection and the given widget,...
Definition: kactioncollection.cpp:718
QList< QAction * > actions() const
Returns the list of KActions which belong to this action collection.
Definition: kactioncollection.cpp:186
void setConfigGlobal(bool global)
Set whether this action collection's configuration should be global to KDE ( true ),...
Definition: kactioncollection.cpp:381
QAction * action(int index) const
Return the QAction* at position "index" in the action collection.
Definition: kactioncollection.cpp:141
void actionTriggered(QAction *action)
Indicates that action was triggered.
bool isShortcutConfigurable() const
Returns true if this action's shortcut is configurable.
Definition: kaction.cpp:173
void setGlobalShortcut(const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut), GlobalShortcutLoading loading=Autoloading)
Assign a global shortcut for this action.
Definition: kaction.cpp:239
@ ActiveShortcut
The shortcut will immediately become active but may be reset to "default".
Definition: kaction.h:235
@ DefaultShortcut
The shortcut is a default shortcut - it becomes active when somebody decides to reset shortcuts to de...
Definition: kaction.h:238
void setShortcut(const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
Set the shortcut for this action.
Definition: kaction.cpp:198
bool isValid() const
Persistent
Global
QString toString() const
Returns a description of the shortcut as a semicolon-separated list of key sequences,...
Definition: kshortcut.cpp:249
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
Definition: kxmlguiclient.h:47
virtual QString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
Definition: kxmlguiclient.cpp:154
virtual KComponentData componentData() const
Definition: kxmlguiclient.cpp:144
static QString readConfigFile(const QString &filename, const KComponentData &componentData=KComponentData())
Definition: kxmlguifactory.cpp:117
static QDomElement actionPropertiesElement(QDomDocument &doc)
Definition: kxmlguifactory.cpp:769
static QDomElement findActionByName(QDomElement &elem, const QString &sName, bool create)
Definition: kxmlguifactory.cpp:783
static bool saveConfigFile(const QDomDocument &doc, const QString &filename, const KComponentData &componentData=KComponentData())
Definition: kxmlguifactory.cpp:142
#define kDebug
#define kWarning
bool authorizeKAction(const QString &action)
const KComponentData & mainComponent()
KSharedConfigPtr config()
group
KAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
Creates an action corresponding to one of the KStandardAction::StandardAction actions,...
Definition: kstandardaction.cpp:82
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.