KDEUI
kxmlguifactory.cpp
Go to the documentation of this file.
92 void applyShortcutScheme(KXMLGUIClient *client, const QList<QAction*>& actions, const QDomDocument& scheme);
93 void refreshActionProperties(KXMLGUIClient *client, const QList<QAction*>& actions, const QDomDocument& doc);
117 QString KXMLGUIFactory::readConfigFile( const QString &filename, const KComponentData &_componentData )
125 KComponentData componentData = _componentData.isValid() ? _componentData : KGlobal::mainComponent();
145 KComponentData componentData = _componentData.isValid() ? _componentData : KGlobal::mainComponent();
305 kWarning() << "The following actions are not plugged into the gui (shortcuts will not work): " << unaddedActions;
348 void KXMLGUIFactoryPrivate::refreshActionProperties(KXMLGUIClient *client, const QList<QAction*>& actions, const QDomDocument& doc)
373 //kDebug() << kaction->objectName() << "default=" << defaultShortcut.toString() << "active=" << activeShortcut.toString();
380 kError(240) << "Shortcut for KAction " << kaction->objectName() << kaction->text() << "set with QShortcut::setShortcut()! See KAction documentation.";
612 void KXMLGUIFactoryPrivate::configureAction( QAction *action, const QDomNamedNodeMap &attributes,
652 } else if ( propertyType == QVariant::UserType && action->property( attrName.toLatin1() ).userType() == qMetaTypeId<KShortcut>() ) {
653 // Setting the shortcut by property also sets the default shortcut (which is incorrect), so we have to do it directly
699 void KXMLGUIFactoryPrivate::applyShortcutScheme(KXMLGUIClient *client, const QList<QAction*> &actions, const QDomDocument& scheme)
746 kDebug(260) << "Applying shortcut scheme for XMLGUI client" << client->componentData().componentName();
758 letterCutsOk ? KShortcutsEditor::LetterShortcutsAllowed : KShortcutsEditor::LetterShortcutsDisallowed,
783 QDomElement KXMLGUIFactory::findActionByName( QDomElement& elem, const QString& sName, bool create )
void setCodec(QTextCodec *codec)
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
virtual KActionCollection * actionCollection() const
Retrieves the entire action collection for the GUI client.
Definition: kxmlguiclient.cpp:128
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
Definition: kxmlguiclient.h:46
QString name() const
QDomNode appendChild(const QDomNode &newChild)
QString attribute(const QString &name, const QString &defValue) const
void removeClient(KXMLGUIClient *client)
Removes the GUI described by the client, by unplugging all provided actions and removing all owned co...
Definition: kxmlguifactory.cpp:411
KXMLGUIFactory(KXMLGUIBuilder *builder, QObject *parent=0)
Constructs a KXMLGUIFactory.
Definition: kxmlguifactory.cpp:190
const KShortcut & shortcut(StandardShortcut id)
Returns the keybinding for accel.
Definition: kstandardshortcut.cpp:285
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
void addClient(KXMLGUIClient *client)
Creates the GUI described by the QDomDocument of the client, using the client's actions, and merges it with the previously created GUI.
Definition: kxmlguifactory.cpp:210
void setIcon(const QIcon &icon)
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
QDomElement nextSiblingElement(const QString &tagName) const
static QDomElement findActionPropertiesElement(const QDomDocument &doc)
Definition: kxmlguifactory.cpp:334
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
Defines platform-independent classes for keyboard shortcut handling.
T value() const
KConfigGroup group(const QByteArray &group)
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
void removeChild(QObject *object)
KXMLGUIFactory * factory() const
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0 if the client...
Definition: kxmlguiclient.cpp:602
QDomElement documentElement() const
NodeType nodeType() const
bool exists() const
The shortcut is a default shortcut - it becomes active when somebody decides to reset shortcuts to de...
Definition: kaction.h:238
void reset()
Use this method to free all memory allocated by the KXMLGUIFactory.
Definition: kxmlguifactory.cpp:496
void reloadXML()
Forces this client to re-read its XML resource file.
Definition: kxmlguiclient.cpp:174
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KSharedConfigPtr config()
QDomNode nextSibling() const
void setFactory(KXMLGUIFactory *factory)
This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GU...
Definition: kxmlguiclient.cpp:597
QDomElement toElement() const
const char * name() const
QList< KXMLGUIClient * > childClients()
Retrieves a list of all child clients.
Definition: kxmlguiclient.cpp:635
void append(const T &value)
QString fromUtf8(const char *str, int size)
void plugActionList(KXMLGUIClient *client, const QString &name, const QList< QAction * > &actionList)
Definition: kxmlguifactory.cpp:564
bool isSeparator() const
QVariant property(const char *name) const
QDomDocument ownerDocument() const
QDomDocument xmlguiBuildDocument() const
Definition: kxmlguiclient.cpp:592
bool isEmpty() const
Returns whether this shortcut contains any nonempty key sequences.
Definition: kshortcut.cpp:144
Implements the creation of the GUI (menubar, menus and toolbars) as requested by the GUI factory...
Definition: kxmlguibuilder.h:41
virtual KComponentData componentData() const
Definition: kxmlguiclient.cpp:144
void setAttribute(const QString &name, const QString &value)
void unplugActionList(KXMLGUIClient *client, const QString &name)
Definition: kxmlguifactory.cpp:583
int toInt(bool *ok, int base) const
objectName
bool isEmpty() 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
QByteArray readAll()
static void removeDOMComments(QDomNode &node)
Removes all QDomComment objects from the specified node and all its children.
Definition: kxmlguifactory.cpp:170
void makingChanges(bool)
Emitted when the factory is currently making changes to the GUI, i.e.
void clientAdded(KXMLGUIClient *client)
QString componentName() const
void resetContainer(const QString &containerName, bool useTagName=false)
Use this method to free all memory allocated by the KXMLGUIFactory for a specific container...
Definition: kxmlguifactory.cpp:503
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
void addCollection(KActionCollection *, const QString &title=QString())
Add all actions of the collection to the ones displayed and configured by the dialog.
Definition: kshortcutsdialog.cpp:153
QString toLower() const
QDomNode removeChild(const QDomNode &oldChild)
QDomNode namedItem(const QString &name) const
bool isRelativePath(const QString &path)
QString value() const
bool isNull() const
Letter shortcuts are allowed.
Definition: kshortcutseditor.h:86
QDomNode firstChild() const
QByteArray toLatin1() const
The shortcut will immediately become active but may be reset to "default".
Definition: kaction.h:235
void changeShortcutScheme(const QString &scheme)
Definition: kxmlguifactory.cpp:397
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
QDomNode cloneNode(bool deep) const
uint length() const
QDomElement firstChildElement(const QString &tagName) const
QTextCodec * codecForName(const QByteArray &name)
void refreshActionProperties()
Use this method to reset and reread action properties (shortcuts, etc.) for all actions.
Definition: kxmlguifactory.cpp:311
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
QDomAttr toAttr() const
bool isValid() const
const KComponentData & mainComponent()
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool isValid() const
virtual QDomDocument domDocument() const
Definition: kxmlguiclient.cpp:149
QWidget * container(const QString &containerName, KXMLGUIClient *client, bool useTagName=false)
Use this method to get access to a container widget with the name specified with containerName and wh...
Definition: kxmlguifactory.cpp:474
bool setProperty(const char *name, const QVariant &value)
QString tagName() const
const QString & staticQString(const char *str)
QDomElement createElement(const QString &tagName)
QList< KXMLGUIClient * > clients() const
Returns a list of all clients currently added to this factory.
Definition: kxmlguifactory.cpp:469
int configureShortcuts(bool bAllowLetterShortcuts=true, bool bSaveSettings=true)
Show a standard configure shortcut for every action in this factory.
Definition: kxmlguifactory.cpp:755
QDomNode item(int index) const
Shortcuts without a modifier are not allowed, so 'A' would not be valid, whereas 'Ctrl+A' would be...
Definition: kshortcutseditor.h:84
void clientRemoved(KXMLGUIClient *client)
QObject * parent() const
int compare(const QString &other) const
KXMLGUIBuilder * clientBuilder() const
Retrieves the client's GUI builder or 0 if no client specific builder has been assigned via setClient...
Definition: kxmlguiclient.cpp:647
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
static QDomElement actionPropertiesElement(QDomDocument &doc)
Definition: kxmlguifactory.cpp:769
QDomDocument toDocument() const
Dialog for configuration of KActionCollection and KGlobalAccel.
Definition: kshortcutsdialog.h:69
QList< QWidget * > containers(const QString &tagName)
Definition: kxmlguifactory.cpp:491
static QDomElement findActionByName(QDomElement &elem, const QString &sName, bool create)
Definition: kxmlguifactory.cpp:783
bool setContent(const QByteArray &data, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn)
void setXMLGUIBuildDocument(const QDomDocument &doc)
Definition: kxmlguiclient.cpp:587
uint toUInt(bool *ok, int base) const
bool configure(bool saveSettings=true)
Run the dialog and call writeSettings() on the action collections that were added if bSaveSettings is...
Definition: kshortcutsdialog.cpp:166
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.