KXmlGui
kxmlguiclient.cpp
154 if (d->m_xmlFile.isEmpty()) { // setXMLFile not called at all, can't save. Use case: ToolBarHandler
158 return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kxmlgui5/%1/%2").arg(componentName(), d->m_xmlFile);
172void KXMLGUIClient::setComponentName(const QString &componentName, const QString &componentDisplayName)
187 QString file = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("kxmlgui5/ui_standards.rc"));
220 allFiles << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kxmlgui5/") + filter);
231 qCWarning(DEBUG_KXMLGUI) << "cannot find .rc file" << _file << "for component" << componentName();
236 const bool exists = QDir::isRelativePath(d->m_localXMLFile) || QFile::exists(d->m_localXMLFile);
256void KXMLGUIClient::replaceXMLFile(const QString &xmlfile, const QString &localxmlfile, bool merge)
304 qCCritical(DEBUG_KXMLGUI) << "Error parsing XML document:" << result.errorMessage << "at line" << result.errorLine << "column"
307 setDOMDocument(QDomDocument(), merge); // otherwise empty menus from ui_standards.rc stay around
356bool KXMLGUIClientPrivate::mergeXML(QDomElement &base, QDomElement &additive, KActionCollection *actionCollection)
533bool KXMLGUIClientPrivate::isEmptyContainer(const QDomElement &base, KActionCollection *actionCollection) const
586QDomElement KXMLGUIClientPrivate::findMatchingElement(const QDomElement &base, const QDomElement &additive)
588 const QString idAttribute(base.tagName() == QLatin1String("ActionProperties") ? QStringLiteral("scheme") : QStringLiteral("name"));
593 n = n.nextSibling(); // Advance now so that we can safely delete e -- TODO we don't, so simplify this
710 // qCDebug(DEBUG_KXMLGUI) << "KXMLGUIClient::addStateActionEnabled( " << state << ", " << action << ")";
720 // qCDebug(DEBUG_KXMLGUI) << "KXMLGUIClient::addStateActionDisabled( " << state << ", " << action << ")";
730void KXMLGUIClient::stateChanged(const QString &newstate, KXMLGUIClient::ReverseStateChange reverse)
void addAssociatedWidget(QWidget *widget)
Associate all actions in this collection to the given widget, including any actions added after this ...
Definition kactioncollection.cpp:830
void setComponentName(const QString &componentName)
Set the componentName associated with this action collection.
Definition kactioncollection.cpp:219
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
QAction * action(int index) const
Return the QAction* at position index in the action collection.
Definition kactioncollection.cpp:203
static Q_INVOKABLE bool authorizeAction(const QString &action)
static QByteArray applicationDomain()
Implements the creation of the GUI (menubar, menus and toolbars) as requested by the GUI factory.
Definition kxmlguibuilder.h:34
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
Definition kxmlguiclient.h:40
KXMLGUIClient * parentClient() const
KXMLGUIClients can form a simple child/parent object tree.
Definition kxmlguiclient.cpp:636
virtual QString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
Definition kxmlguiclient.cpp:139
virtual void setDOMDocument(const QDomDocument &document, bool merge=false)
Sets the Document for the part, describing the layout of the GUI.
Definition kxmlguiclient.cpp:319
static QString findVersionNumber(const QString &xml)
Returns the version number of the given xml data (belonging to an xml rc file)
Definition kxmlguiclient.cpp:781
void replaceXMLFile(const QString &xmlfile, const QString &localxmlfile, bool merge=false)
Sets a new xmlFile() and localXMLFile().
Definition kxmlguiclient.cpp:256
KXMLGUIClient()
Constructs a KXMLGUIClient which can be used with a KXMLGUIFactory to create a GUI from actions and a...
Definition kxmlguiclient.cpp:65
void removeChildClient(KXMLGUIClient *child)
Removes the given child from the client's children list.
Definition kxmlguiclient.cpp:650
void reloadXML()
Forces this client to re-read its XML resource file.
Definition kxmlguiclient.cpp:161
virtual void stateChanged(const QString &newstate, ReverseStateChange reverse=StateNoReverse)
Actions can collectively be assigned a "State".
Definition kxmlguiclient.cpp:730
static QString standardsXmlFileLocation()
Return the full path to the ui_standards.rc, might return a resource path.
Definition kxmlguiclient.cpp:182
virtual KActionCollection * actionCollection() const
Retrieves the entire action collection for the GUI client.
Definition kxmlguiclient.cpp:115
void unplugActionList(const QString &name)
Unplugs the action list name from the XMLGUI.
Definition kxmlguiclient.cpp:689
void plugActionList(const QString &name, const QList< QAction * > &actionList)
ActionLists are a way for XMLGUI to support dynamic lists of actions.
Definition kxmlguiclient.cpp:680
virtual void setXMLFile(const QString &file, bool merge=false, bool setXMLDoc=true)
Sets the name of the rc file containing the XML for the part.
Definition kxmlguiclient.cpp:201
QList< KXMLGUIClient * > childClients()
Retrieves a list of all child clients.
Definition kxmlguiclient.cpp:665
KXMLGUIFactory * factory() const
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return nullptr if the ...
Definition kxmlguiclient.cpp:631
void setXMLGUIBuildDocument(const QDomDocument &doc)
Definition kxmlguiclient.cpp:616
void setClientBuilder(KXMLGUIBuilder *builder)
A client can have an own KXMLGUIBuilder.
Definition kxmlguiclient.cpp:670
virtual void setLocalXMLFile(const QString &file)
Set the full path to the "local" xml file, the one used for saving toolbar and shortcut changes.
Definition kxmlguiclient.cpp:251
QAction * action(const QString &name) const
Retrieves an action of the client by name.
Definition kxmlguiclient.cpp:101
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:626
virtual void setXML(const QString &document, bool merge=false)
Sets the XML for the part.
Definition kxmlguiclient.cpp:296
KXMLGUIBuilder * clientBuilder() const
Retrieves the client's GUI builder or nullptr if no client specific builder has been assigned via set...
Definition kxmlguiclient.cpp:675
void insertChildClient(KXMLGUIClient *child)
Use this method to make a client a child client of another client.
Definition kxmlguiclient.cpp:641
QDomDocument xmlguiBuildDocument() const
Definition kxmlguiclient.cpp:621
virtual void setComponentName(const QString &componentName, const QString &componentDisplayName)
Sets the component name for this part.
Definition kxmlguiclient.cpp:172
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Definition kxmlguifactory.h:56
static QString readConfigFile(const QString &filename, const QString &componentName=QString())
Definition kxmlguifactory.cpp:96
Q_SCRIPTABLE Q_NOREPLY void abort()
QString name(StandardAction id)
void setEnabled(bool)
bool isSpace(char32_t ucs4)
bool isAbsolutePath(const QString &path)
bool isRelativePath(const QString &path)
QDomElement documentElement() const const
ParseResult setContent(QAnyStringView text, ParseOptions options)
QString attribute(const QString &name, const QString &defValue) const const
QDomNamedNodeMap attributes() const const
QDomNodeList elementsByTagName(const QString &tagname) const const
void setAttribute(const QString &name, const QString &value)
QString tagName() const const
int count() const const
QDomNode item(int index) const const
QDomNode appendChild(const QDomNode &newChild)
QDomNode firstChild() const const
QDomNode insertBefore(const QDomNode &newChild, const QDomNode &refChild)
bool isNull() const const
QDomNode lastChild() const const
QDomNode nextSibling() const const
QString nodeName() const const
QString nodeValue() const const
QDomNode parentNode() const const
QDomNode previousSibling() const const
QDomNode removeChild(const QDomNode &oldChild)
QDomNode replaceChild(const QDomNode &newChild, const QDomNode &oldChild)
QDomElement toElement() const const
QDomNode item(int index) const const
int length() const const
bool exists() const const
void append(QList< T > &&value)
bool isEmpty() const const
void prepend(parameter_type value)
GenericDataLocation
QString locate(StandardLocation type, const QString &fileName, LocateOptions options)
QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options)
QString writableLocation(StandardLocation type)
const QChar at(qsizetype position) const const
int compare(QLatin1StringView s1, const QString &s2, Qt::CaseSensitivity cs)
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
QString fromUtf8(QByteArrayView str)
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
bool isNull() const const
qsizetype length() const const
QString mid(qsizetype position, qsizetype n) const const
int toInt(bool *ok, int base) const const
const QChar * unicode() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
CaseInsensitive
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:13:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:13:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.