KXmlGui
kxmlguiwindow.cpp
55 static QVector<KCommandBar::ActionGroup> actionCollectionToActionGroup(const std::vector<KActionCollection *> &actionCollections)
106 static void getActionCollections(KXMLGUIClient *client, std::vector<KActionCollection *> &actionCollections)
230 QDBusConnection::sessionBus().registerObject(dbusName() + QLatin1String("/actions"), actionCollection(), opts);
268 connect(d->toolBarEditor, &KEditToolBar::newToolBarConfig, this, &KXmlGuiWindow::saveNewToolbarConfig);
289 void KXmlGuiWindow::setupGUI(const QSize &defaultSize, StandardWindowOptions options, const QString &xmlfile)
294 KStandardAction::keyBindings(guiFactory(), &KXMLGUIFactory::showConfigureShortcutsDialog, actionCollection());
303 KStandardAction::configureToolbars(this, &KXmlGuiWindow::configureToolbars, actionCollection());
382 const QString windowXmlFile = xmlfile.isNull() ? componentName() + QLatin1String("ui.rc") : xmlfile;
386 qCWarning(DEBUG_KXMLGUI) << "You called setXMLFile(" << xmlFile() << ") and then createGUI or setupGUI,"
388 << "You should call createGUI(" << xmlFile() << ") or setupGUI(<options>," << xmlFile() << ") instead.";
456 d->showStatusBarAction = KStandardAction::showStatusbar(this, &KMainWindow::setSettingsDirty, actionCollection());
513 // If the shortcut is already in use we give a warning, so that hopefully the developer will find it
515 // and "deleteFileAction" is the other action since Shift+Delete is used for both in our default code
531 const QString existingShortcutActionName = KLocalizedString::removeAcceleratorMarker(existingShortcutAction->text());
535 i18n("There are two actions (%1, %2) that want to use the same shortcut (%3). This is most probably a bug. "
void adjustSize()
void setSettingsDirty()
Tell the main window that it should save its settings when being closed.
Definition: kmainwindow.cpp:820
bool isNull() const const
QList< QAction * > actions() const
Returns the list of QActions which belong to this action collection.
Definition: kactioncollection.cpp:207
QAction * configureToolbars(const QObject *recvr, const char *slot, QObject *parent)
void setXMLGUIBuildDocument(const QDomDocument &doc)
Definition: kxmlguiclient.cpp:627
@ Keys
Adds an action to open the configure keyboard shortcuts dialog.
Definition: kxmlguiwindow.h:200
bool event(QEvent *event) override
Reimplemented to catch QEvent::Polish in order to adjust the object name if needed,...
Definition: kmainwindow.cpp:906
QList< KXMLGUIClient * > clients() const
Returns a list of all clients currently added to this factory.
Definition: kxmlguifactory.cpp:469
QList< QAction * > actions() const const
Polish
void removeClient(KXMLGUIClient *client)
Removes the GUI described by the client, by unplugging all provided actions and removing all owned co...
Definition: kxmlguifactory.cpp:408
@ Save
Auto-saves (and loads) the toolbar/menubar/statusbar settings and window size using the default name.
Definition: kxmlguiwindow.h:221
void showConfigureShortcutsDialog()
Shows a dialog (KShortcutsDialog) that lists every action in this factory, and which can be used to c...
Definition: kxmlguifactory.cpp:728
int removeAll(const T &value)
void setShortcuts(const QList< QKeySequence > &shortcuts)
const T value(const Key &key, const T &defaultValue) const const
QString dbusName() const
Returns the path under which this window's D-Bus object is exported.
Definition: kmainwindow.cpp:1031
void setupToolbarMenuActions()
Definition: kxmlguiwindow.cpp:204
void setDefaultShortcut(QAction *action, const QKeySequence &shortcut)
Set the default shortcut for the given action.
Definition: kactioncollection.cpp:409
bool isStandardToolBarMenuEnabled() const
Returns true if the toolbar menu is enabled, false otherwise.
Definition: kxmlguiwindow.cpp:446
void append(const T &value)
Definition: kxmlguifactory.h:55
QIcon fromTheme(const QString &name)
bool event(QEvent *event) override
Reimplemented to catch QEvent::Polish in order to adjust the object name if needed,...
Definition: kxmlguiwindow.cpp:218
bool isValid() const
void createStandardStatusBarAction()
Sets whether KMainWindow should provide a menu that allows showing/hiding of the statusbar (using KSt...
Definition: kxmlguiwindow.cpp:452
void applyMainWindowSettings(const KConfigGroup &config) override
Read settings for statusbar, menubar and toolbar from their respective groups in the config file and ...
Definition: kxmlguiwindow.cpp:480
bool registerObject(const QString &path, QObject *object, QDBusConnection::RegisterOptions options)
void reserve(int size)
QAction * toolBarMenuAction()
Returns a pointer to the mainwindows action responsible for the toolbars menu.
Definition: kxmlguiwindow.cpp:194
KToggleAction * showStatusbar(const QObject *recvr, const char *slot, QObject *parent)
void checkAmbiguousShortcuts()
Checks if there are actions using the same shortcut.
Definition: kxmlguiwindow.cpp:497
Q_INVOKABLE QAction * addAction(const QString &name, QAction *action)
Add an action under the given name to the collection.
Definition: kactioncollection.cpp:234
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QAction * keyBindings(const QObject *recvr, const char *slot, QObject *parent)
void createGUI(const QString &xmlfile=QString())
Creates a GUI based on a local XML file.
Definition: kxmlguiwindow.cpp:327
KConfigGroup autoSaveConfigGroup() const
Definition: kmainwindow.cpp:877
void reserve(int alloc)
NativeText
Definition: kxmlguiclient.h:39
QMap::iterator insert(const Key &key, const T &value)
virtual void setVisible(bool visible)
typedef WindowFlags
void reset()
Use this method to free all memory allocated by the KXMLGUIFactory.
Definition: kxmlguifactory.cpp:495
void setHelpMenuEnabled(bool showHelpMenu=true)
Enables the build of a standard help menu when calling createGUI() or setupGUI().
Definition: kxmlguiwindow.cpp:236
int size() const const
void setIcon(const QIcon &icon)
QString i18n(const char *text, const TYPE &arg...)
QDBusConnection sessionBus()
virtual QString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
Definition: kxmlguiclient.cpp:141
void toggled(bool checked)
virtual void saveNewToolbarConfig()
Rebuilds the GUI after KEditToolBar changed the toolbar layout.
Definition: kxmlguiwindow.cpp:273
int indexOf(const T &value, int from) const const
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:203
KREPORT_EXPORT QPageSize::PageSizeId defaultSize()
KXMLGUIFactory * factory() const
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return nullptr if the ...
Definition: kxmlguiclient.cpp:642
void newToolBarConfig()
Signal emitted when 'apply' or 'ok' is clicked or toolbars were reset.
QAction * action(int index) const
Return the QAction* at position index in the action collection.
Definition: kactioncollection.cpp:145
text
bool isEmpty() const const
@ Create
calls createGUI() once ToolBar, Keys and Statusbar have been taken care of.
Definition: kxmlguiwindow.h:237
static KAboutData applicationData()
virtual void slotStateChanged(const QString &newstate)
Apply a state change.
Definition: kxmlguiwindow.cpp:409
Key_I
void reserve(int size)
whatsThis
void addClient(KXMLGUIClient *client)
Creates the GUI described by the QDomDocument of the client, using the client's actions,...
Definition: kxmlguifactory.cpp:197
QString & remove(int position, int n)
QStatusBar * statusBar() const const
void setStandardToolBarMenuEnabled(bool enable)
Sets whether KMainWindow should provide a menu that allows showing/hiding the available toolbars (usi...
Definition: kxmlguiwindow.cpp:419
void resize(int w, int h)
QAction * action(const char *name) const
Retrieves an action of the client by name.
Definition: kxmlguiclient.cpp:103
KXmlGuiWindow(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Construct a main window.
Definition: kxmlguiwindow.cpp:147
virtual KActionCollection * actionCollection() const
Retrieves the entire action collection for the GUI client.
Definition: kxmlguiclient.cpp:117
void setupGUI(StandardWindowOptions options=Default, const QString &xmlfile=QString())
Configures the current window and its actions in the typical KDE fashion.
Definition: kxmlguiwindow.cpp:284
bool isEnabled() const const
virtual void configureToolbars()
Show a standard configure toolbar dialog.
Definition: kxmlguiwindow.cpp:260
void setActions(const QVector< ActionGroup > &actions)
QEvent::Type type() const const
ExportScriptableSlots
objectName
QList< QKeySequence > shortcuts() const const
CTRL
static QString removeAcceleratorMarker(const QString &label)
void saveMainWindowSettings(KConfigGroup &config)
Save settings for statusbar, menubar and toolbar to their respective groups in the config group confi...
Definition: kmainwindow.cpp:626
virtual void applyMainWindowSettings(const KConfigGroup &config)
Read settings for statusbar, menubar and toolbar from their respective groups in the config file and ...
Definition: kmainwindow.cpp:715
void setAutoSaveSettings(const QString &groupName=QStringLiteral("MainWindow"), bool saveWindowSize=true)
Call this to enable "auto-save" of toolbar/menubar/statusbar settings (and optionally window size).
Definition: kmainwindow.cpp:832
void information(QWidget *parent, const QString &text, const QString &title=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
AllowLink
bool isHelpMenuEnabled() const
Returns true if the help menu is enabled, false otherwise.
Definition: kxmlguiwindow.cpp:242
bool isHidden() const const
virtual void stateChanged(const QString &newstate, ReverseStateChange reverse=StateNoReverse)
Actions can collectively be assigned a "State".
Definition: kxmlguiclient.cpp:741
Definition: kxmlguibuilder.h:33
void makingChanges(bool)
Emitted when the factory is currently making changes to the GUI, i.e.
Notify
WA_DeleteOnClose
QList< KXMLGUIClient * > childClients()
Retrieves a list of all child clients.
Definition: kxmlguiclient.cpp:676
Q_D(Todo)
void setCommandBarEnabled(bool enable)
Enable a hud style menu which allows listing and executing actions.
Definition: kxmlguiwindow.cpp:552
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:11:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:11:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.