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.";
337 KAction *KActionCollection::addAction(KStandardAction::StandardAction actionType, const QObject *receiver, const char *member)
343 KAction *KActionCollection::addAction(KStandardAction::StandardAction actionType, const QString &name,
346 // pass 0 as parent, because if the parent is a KActionCollection KStandardAction::create automatically
358 KAction *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() << ")!";
563 void 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*)));
void removeAssociatedWidget(QWidget *widget)
Remove an association between all actions in this collection and the given widget, i.e.
Definition: kactioncollection.cpp:718
void associateWidget(QWidget *widget) const
Associate all actions in this collection to the given widget.
Definition: kactioncollection.cpp:700
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
Definition: kxmlguiclient.h:46
const QList< QActionGroup * > actionGroups() const
Returns the list of all QActionGroups associated with actions in this action collection.
Definition: kactioncollection.cpp:200
KComponentData componentData() const
The KComponentData with which this class is associated.
Definition: kactioncollection.cpp:176
void setConfigGlobal(bool global)
Set whether this action collection's configuration should be global to KDE ( true )...
Definition: kactioncollection.cpp:381
QList< QWidget * > associatedWidgets() const
Return a list of all associated widgets.
Definition: kactioncollection.cpp:761
QT_MOC_COMPAT void removed(QAction *action)
Indicates that action was removed from this action collection.
void actionTriggered(QAction *action)
Indicates that action was triggered.
const QList< QAction * > actionsWithoutGroup() const
Returns the list of KActions without an QAction::actionGroup() which belong to this action collection...
Definition: kactioncollection.cpp:191
static const QList< KActionCollection * > & allCollections()
Access the list of all action collections in existence for this app.
Definition: kactioncollection.cpp:695
void inserted(QAction *action)
Indicates that action was inserted into this action collection.
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void writeSettings(KConfigGroup *config=0, bool writeDefaults=false, QAction *oneAction=0) const
Write the current configurable key associations to config.
Definition: kactioncollection.cpp:563
QAction * addAction(const QString &name, QAction *action)
Add an action under the given name to the collection.
Definition: kactioncollection.cpp:217
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
virtual QString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
Definition: kxmlguiclient.cpp:154
bool configIsGlobal() const
Returns whether this action collection's configuration should be global to KDE ( true )...
The shortcut is a default shortcut - it becomes active when somebody decides to reset shortcuts to de...
Definition: kaction.h:238
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KSharedConfigPtr config()
int count() const
Returns the number of actions in the collection.
Definition: kactioncollection.cpp:147
void deleteEntry(const QString &pKey, WriteConfigFlags pFlags=Normal)
virtual KComponentData componentData() const
Definition: kxmlguiclient.cpp:144
bool exists() const
static QString readConfigFile(const QString &filename, const KComponentData &componentData=KComponentData())
Definition: kxmlguifactory.cpp:117
QList< QAction * > actions() const
Returns the list of KActions which belong to this action collection.
Definition: kactioncollection.cpp:186
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 removeAction(QAction *action)
Removes an action from the collection and deletes it.
Definition: kactioncollection.cpp:316
QT_MOC_COMPAT void actionHighlighted(QAction *action)
Indicates that action was highlighted (hovered over).
QAction * takeAction(QAction *action)
Removes an action from the collection.
Definition: kactioncollection.cpp:321
void setShortcut(const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
Set the shortcut for this action.
Definition: kaction.cpp:198
void clear()
Clears the entire action collection, deleting all actions.
Definition: kactioncollection.cpp:124
void setComponentData(const KComponentData &componentData)
Set the componentData associated with this action collection.
Definition: kactioncollection.cpp:157
void clearAssociatedWidgets()
Clear all associated widgets and remove the actions from those widgets.
Definition: kactioncollection.cpp:766
void actionHovered(QAction *action)
Indicates that action was hovered.
void exportGlobalShortcuts(KConfigGroup *config, bool writeDefaults=false) const
Export the current configurable global key associations to config.
Definition: kactioncollection.cpp:444
The shortcut will immediately become active but may be reset to "default".
Definition: kaction.h:235
KActionCollection(QObject *parent, const KComponentData &cData=KComponentData())
Constructor.
Definition: kactioncollection.cpp:96
bool isEmpty() const
Returns whether the action collection is empty or not.
Definition: kactioncollection.cpp:152
KAction * 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.
Definition: kstandardaction.cpp:82
bool isValid() const
void addAssociatedWidget(QWidget *widget)
Associate all actions in this collection to the given widget, including any actions added after this ...
Definition: kactioncollection.cpp:708
const KComponentData & mainComponent()
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool isShortcutConfigurable() const
Returns true if this action's shortcut is configurable.
Definition: kaction.cpp:173
QAction * action(int index) const
Return the QAction* at position "index" in the action collection.
Definition: kactioncollection.cpp:141
void setGlobalShortcut(const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut), GlobalShortcutLoading loading=Autoloading)
Assign a global shortcut for this action.
Definition: kaction.cpp:239
virtual void slotActionTriggered()
Definition: kactioncollection.cpp:636
void sync()
const KXMLGUIClient * parentGUIClient() const
The parent KXMLGUIClient, or null if not available.
Definition: kactioncollection.cpp:181
void setConfigGroup(const QString &group)
Sets group as the KConfig group with which settings will be loaded and saved.
Definition: kactioncollection.cpp:371
QString toString() const
Returns a description of the shortcut as a semicolon-separated list of key sequences, as returned by QKeySequence::toString().
Definition: kshortcut.cpp:249
static bool saveConfigFile(const QDomDocument &doc, const QString &filename, const KComponentData &componentData=KComponentData())
Definition: kxmlguifactory.cpp:142
T readEntry(const QString &key, const T &aDefault) const
void readSettings(KConfigGroup *config=0)
Read all key associations from config.
Definition: kactioncollection.cpp:413
virtual QT_MOC_COMPAT void slotActionHighlighted()
Definition: kactioncollection.cpp:643
Prevent autoloading of saved global shortcut for action.
Definition: kaction.h:253
static QDomElement actionPropertiesElement(QDomDocument &doc)
Definition: kxmlguifactory.cpp:769
bool authorizeKAction(const QString &action)
QString configGroup() const
Returns the KConfig group with which settings will be loaded and saved.
static QDomElement findActionByName(QDomElement &elem, const QString &sName, bool create)
Definition: kxmlguifactory.cpp:783
void importGlobalShortcuts(KConfigGroup *config)
Import from config all configurable global key associations.
Definition: kactioncollection.cpp:386
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.