KXmlGui
kactioncollection.cpp
253 qCDebug(DEBUG_KXMLGUI) << "Registering action " << objectName << " under new name " << indexName;
366QAction *KActionCollection::addAction(KStandardAction::StandardAction actionType, const QObject *receiver, const char *member)
372QAction *KActionCollection::addAction(KStandardAction::StandardAction actionType, const QString &name, const QObject *receiver, const char *member)
386QAction *KActionCollection::addAction(const QString &name, const QObject *receiver, const char *member)
411void KActionCollection::setDefaultShortcuts(QAction *action, const QList<QKeySequence> &shortcuts)
457 for (QMap<QString, QAction *>::ConstIterator it = d->actionByName.constBegin(); it != d->actionByName.constEnd(); ++it) {
491 for (QMap<QString, QAction *>::ConstIterator it = d->actionByName.constBegin(); it != d->actionByName.constEnd(); ++it) {
519 for (QMap<QString, QAction *>::ConstIterator it = d->actionByName.constBegin(); it != d->actionByName.constEnd(); ++it) {
529 qCCritical(DEBUG_KXMLGUI) << "Skipped exporting Shortcut for action without name " << action->text() << "!";
535 bool bSameAsDefault = (KGlobalAccel::self()->shortcut(action) == KGlobalAccel::self()->defaultShortcut(action));
589 for (QMap<QString, QAction *>::ConstIterator it = actionByName.constBegin(); it != actionByName.constEnd(); ++it) {
600 qCCritical(DEBUG_KXMLGUI) << "Skipped writing shortcut for action " << actionName << "(" << action->text() << ")!";
605 qCDebug(DEBUG_KXMLGUI) << "name = " << actionName << " shortcut = " << QKeySequence::listToString(action->shortcuts())
620 // qCDebug(DEBUG_KXMLGUI) << "act_elem.attributes().count() = " << act_elem.attributes().count();
637void KActionCollection::writeSettings(KConfigGroup *config, bool writeAll, QAction *oneAction) const
657 for (QMap<QString, QAction *>::ConstIterator it = d->actionByName.constBegin(); it != d->actionByName.constEnd(); ++it) {
Q_INVOKABLE QAction * addAction(const QString &name, QAction *action)
Add an action under the given name to the collection.
Definition kactioncollection.cpp:234
static QKeySequence defaultShortcut(QAction *action)
Get the default primary shortcut for the given action.
Definition kactioncollection.cpp:395
static bool isShortcutsConfigurable(QAction *action)
Returns true if the given action's shortcuts may be configured by the user.
Definition kactioncollection.cpp:417
void addActions(const QList< QAction * > &actions)
Adds a list of actions to the collection.
Definition kactioncollection.cpp:337
void addAssociatedWidget(QWidget *widget)
Associate all actions in this collection to the given widget, including any actions added after this ...
Definition kactioncollection.cpp:782
int count() const
Returns the number of actions in the collection.
Definition kactioncollection.cpp:151
QList< QWidget * > associatedWidgets() const
Return a list of all associated widgets.
Definition kactioncollection.cpp:838
void actionHovered(QAction *action)
Indicates that action was hovered.
QString componentDisplayName() const
The display name for the associated component.
Definition kactioncollection.cpp:191
void connectNotify(const QMetaMethod &signal) override
Overridden to perform connections when someone wants to know whether an action was highlighted or tri...
Definition kactioncollection.cpp:742
void clear()
Clears the entire action collection, deleting all actions.
Definition kactioncollection.cpp:127
void importGlobalShortcuts(KConfigGroup *config)
Import from config all configurable global key associations.
Definition kactioncollection.cpp:449
void exportGlobalShortcuts(KConfigGroup *config, bool writeDefaults=false) const
Export the current configurable global key associations to config.
Definition kactioncollection.cpp:511
void setConfigGroup(const QString &group)
Sets group as the KConfig group with which settings will be loaded and saved.
Definition kactioncollection.cpp:434
void setComponentName(const QString &componentName)
Set the componentName associated with this action collection.
Definition kactioncollection.cpp:161
void clearAssociatedWidgets()
Clear all associated widgets and remove the actions from those widgets.
Definition kactioncollection.cpp:843
static void setShortcutsConfigurable(QAction *action, bool configurable)
Indicate whether the user may configure the action's shortcuts.
Definition kactioncollection.cpp:424
void associateWidget(QWidget *widget) const
Associate all actions in this collection to the given widget.
Definition kactioncollection.cpp:773
const KXMLGUIClient * parentGUIClient() const
The parent KXMLGUIClient, or null if not available.
Definition kactioncollection.cpp:202
const QList< QAction * > actionsWithoutGroup() const
Returns the list of QActions without an QAction::actionGroup() which belong to this action collection...
Definition kactioncollection.cpp:212
QAction * takeAction(QAction *action)
Removes an action from the collection.
Definition kactioncollection.cpp:349
bool isEmpty() const
Returns whether the action collection is empty or not.
Definition kactioncollection.cpp:156
KActionCollection(QObject *parent, const QString &cName=QString())
Constructor.
Definition kactioncollection.cpp:103
static void setDefaultShortcut(QAction *action, const QKeySequence &shortcut)
Set the default shortcut for the given action.
Definition kactioncollection.cpp:406
const QList< QActionGroup * > actionGroups() const
Returns the list of all QActionGroups associated with actions in this action collection.
Definition kactioncollection.cpp:223
static Q_INVOKABLE void setDefaultShortcuts(QAction *action, const QList< QKeySequence > &shortcuts)
Set the default shortcuts for the given action.
Definition kactioncollection.cpp:411
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:637
void removeAction(QAction *action)
Removes an action from the collection and deletes it.
Definition kactioncollection.cpp:344
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:181
static const QList< KActionCollection * > & allCollections()
Access the list of all action collections in existence for this app.
Definition kactioncollection.cpp:768
void setComponentDisplayName(const QString &displayName)
Set the component display name associated with this action collection.
Definition kactioncollection.cpp:186
static QList< QKeySequence > defaultShortcuts(QAction *action)
Get the default shortcuts for the given action.
Definition kactioncollection.cpp:401
void removeAssociatedWidget(QWidget *widget)
Remove an association between all actions in this collection and the given widget,...
Definition kactioncollection.cpp:794
void readSettings(KConfigGroup *config=nullptr)
Read all key associations from config.
Definition kactioncollection.cpp:480
QList< QAction * > actions() const
Returns the list of QActions which belong to this action collection.
Definition kactioncollection.cpp:207
void setConfigGlobal(bool global)
Set whether this action collection's configuration should be global to KDE ( true ),...
Definition kactioncollection.cpp:444
QAction * action(int index) const
Return the QAction* at position index in the action collection.
Definition kactioncollection.cpp:145
void actionTriggered(QAction *action)
Indicates that action was triggered.
static Q_INVOKABLE bool authorizeAction(const QString &action)
Persistent
Global
void deleteEntry(const char *key, WriteConfigFlags pFlags=Normal)
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
QString readEntry(const char *key, const char *aDefault=nullptr) const
bool exists() const
bool sync() override
bool hasShortcut(const QAction *action) const
static KGlobalAccel * self()
bool setShortcut(QAction *action, const QList< QKeySequence > &shortcut, GlobalShortcutLoading loadFlag=Autoloading)
NoAutoloading
QList< QKeySequence > shortcut(const QAction *action) const
QList< QKeySequence > defaultShortcut(const QAction *action) const
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
Definition kxmlguiclient.h:40
virtual QString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
Definition kxmlguiclient.cpp:139
static QString readConfigFile(const QString &filename, const QString &componentName=QString())
Definition kxmlguifactory.cpp:96
static bool saveConfigFile(const QDomDocument &doc, const QString &filename, const QString &componentName=QString())
Definition kxmlguifactory.cpp:122
static QDomElement actionPropertiesElement(QDomDocument &doc)
Definition kxmlguifactory.cpp:700
static QDomElement findActionByName(QDomElement &elem, const QString &sName, bool create)
Definition kxmlguifactory.cpp:714
QString name(GameStandardAction id)
QAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
StandardAction
Category category(StandardShortcut id)
const QList< QKeySequence > & shortcut(StandardShortcut id)
QActionGroup * actionGroup() const const
void setEnabled(bool)
void hovered()
void setShortcuts(QKeySequence::StandardKey key)
QList< QKeySequence > shortcuts() const const
text
void triggered(bool checked)
void setVisible(bool)
applicationName
ParseResult setContent(QAnyStringView text, ParseOptions options)
QDomNamedNodeMap attributes() const const
void removeAttribute(const QString &name)
void setAttribute(const QString &name, const QString &value)
int count() const const
bool isNull() const const
QDomNode removeChild(const QDomNode &oldChild)
applicationDisplayName
QList< QKeySequence > listFromString(const QString &str, SequenceFormat format)
QString listToString(const QList< QKeySequence > &list, SequenceFormat format)
void append(QList< T > &&value)
bool contains(const AT &value) const const
T & first()
qsizetype indexOf(const AT &value, qsizetype from) const const
bool isEmpty() const const
qsizetype removeAll(const AT &t)
void removeAt(qsizetype i)
T value(qsizetype i) const const
ConstIterator
const_iterator constBegin() const const
const_iterator constEnd() const const
size_type remove(const Key &key)
QByteArray methodSignature() const const
Q_EMITQ_EMIT
bool blockSignals(bool block)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
virtual void connectNotify(const QMetaMethod &signal)
void destroyed(QObject *obj)
bool disconnect(const QMetaObject::Connection &connection)
QList< T > findChildren(Qt::FindChildOptions options) const const
objectName
QObject * parent() const const
QVariant property(const char *name) const const
T qobject_cast(QObject *object)
QObject * sender() const const
void setObjectName(QAnyStringView name)
void setParent(QObject *parent)
bool setProperty(const char *name, QVariant &&value)
iterator insert(const T &value)
QList< T > values() const const
QString asprintf(const char *cformat,...)
bool isEmpty() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QVariant fromValue(T &&value)
bool isValid() const const
bool toBool() const const
T value() const const
QList< QAction * > actions() const const
QAction * addAction(const QIcon &icon, const QString &text)
void addActions(const QList< QAction * > &actions)
void removeAction(QAction *action)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 25 2024 11:50:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 25 2024 11:50:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.