KXmlGui
kxmlguiwindow.cpp
56static QList<KCommandBar::ActionGroup> actionCollectionToActionGroup(const std::vector<KActionCollection *> &actionCollections)
107static void getActionCollections(KXMLGUIClient *client, std::vector<KActionCollection *> &actionCollections)
231 QDBusConnection::sessionBus().registerObject(dbusName() + QLatin1String("/actions"), actionCollection(), opts);
269 connect(d->toolBarEditor, &KEditToolBar::newToolBarConfig, this, &KXmlGuiWindow::saveNewToolbarConfig);
290void KXmlGuiWindow::setupGUI(const QSize &defaultSize, StandardWindowOptions options, const QString &xmlfile)
295 KStandardActions::keyBindings(guiFactory(), &KXMLGUIFactory::showConfigureShortcutsDialog, actionCollection());
304 KStandardActions::configureToolbars(this, &KXmlGuiWindow::configureToolbars, actionCollection());
383 const QString windowXmlFile = xmlfile.isNull() ? componentName() + QLatin1String("ui.rc") : xmlfile;
387 qCWarning(DEBUG_KXMLGUI) << "You called setXMLFile(" << xmlFile() << ") and then createGUI or setupGUI,"
457 d->showStatusBarAction = KStandardAction::showStatusbar(this, &KMainWindow::setSettingsDirty, actionCollection());
507 // If the shortcut is already in use we give a warning, so that hopefully the developer will find it
509 // and "deleteFileAction" is the other action since Shift+Delete is used for both in our default code
525 const QString existingShortcutActionName = KLocalizedString::removeAcceleratorMarker(existingShortcutAction->text());
529 i18n("There are two actions (%1, %2) that want to use the same shortcut (%3). This is most probably a bug. "
static KAboutData applicationData()
Q_INVOKABLE QAction * addAction(const QString &name, QAction *action)
Add an action under the given name to the collection.
Definition kactioncollection.cpp:234
static void setDefaultShortcut(QAction *action, const QKeySequence &shortcut)
Set the default shortcut for the given action.
Definition kactioncollection.cpp:406
QList< QAction * > actions() const
Returns the list of QActions which belong to this action collection.
Definition kactioncollection.cpp:207
QAction * action(int index) const
Return the QAction* at position index in the action collection.
Definition kactioncollection.cpp:145
bool isValid() const
void newToolBarConfig()
Signal emitted when 'apply' or 'ok' is clicked or toolbars were reset.
static QString removeAcceleratorMarker(const QString &label)
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:660
bool event(QEvent *event) override
Reimplemented to catch QEvent::Polish in order to adjust the object name if needed,...
Definition kmainwindow.cpp:836
void setAutoSaveSettings(const QString &groupName=QStringLiteral("MainWindow"), bool saveWindowSize=true)
This enables autosave of toolbar/menubar/statusbar settings (and optionally window size).
Definition kmainwindow.cpp:762
void setSettingsDirty()
Tell the main window that it should save its settings when being closed.
Definition kmainwindow.cpp:750
KConfigGroup autoSaveConfigGroup() const
Definition kmainwindow.cpp:807
void saveMainWindowSettings(KConfigGroup &config)
Manually save the settings for statusbar, menubar and toolbar to their respective groups in the KConf...
Definition kmainwindow.cpp:572
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
virtual QString xmlFile() const
This will return the name of the XML file as set by setXMLFile().
Definition kxmlguiclient.cpp:139
virtual void stateChanged(const QString &newstate, ReverseStateChange reverse=StateNoReverse)
Actions can collectively be assigned a "State".
Definition kxmlguiclient.cpp:730
virtual KActionCollection * actionCollection() const
Retrieves the entire action collection for the GUI client.
Definition kxmlguiclient.cpp:115
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
QAction * action(const QString &name) const
Retrieves an action of the client by name.
Definition kxmlguiclient.cpp:101
KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create a GUI of container widgets...
Definition kxmlguifactory.h:56
QList< KXMLGUIClient * > clients() const
Returns a list of all clients currently added to this factory.
Definition kxmlguifactory.cpp:440
void removeClient(KXMLGUIClient *client)
Removes the GUI described by the client, by unplugging all provided actions and removing all owned co...
Definition kxmlguifactory.cpp:379
void addClient(KXMLGUIClient *client)
Creates the GUI described by the QDomDocument of the client, using the client's actions,...
Definition kxmlguifactory.cpp:168
void reset()
Use this method to free all memory allocated by the KXMLGUIFactory.
Definition kxmlguifactory.cpp:466
void showConfigureShortcutsDialog()
Shows a dialog (KShortcutsDialog) that lists every action in this factory, and which can be used to c...
Definition kxmlguifactory.cpp:682
void makingChanges(bool)
Emitted when the factory is currently making changes to the GUI, i.e.
KMainWindow with convenience functions and integration with XmlGui files.
Definition kxmlguiwindow.h:88
void createGUI(const QString &xmlfile=QString())
Generates the interface based on a local XML file.
Definition kxmlguiwindow.cpp:328
KXmlGuiWindow(QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
Construct a main window.
Definition kxmlguiwindow.cpp:148
void createStandardStatusBarAction()
Creates a toggle under the 'Settings' menu to show/hide the statusbar.
Definition kxmlguiwindow.cpp:453
void setStandardToolBarMenuEnabled(bool showToolBarMenu)
Creates a toggle under the 'Settings' menu to show/hide the available toolbars.
Definition kxmlguiwindow.cpp:420
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:481
bool isStandardToolBarMenuEnabled() const
Returns whether setStandardToolBarMenuEnabled() was set.
Definition kxmlguiwindow.cpp:447
@ StatusBar
Adds an action to show/hide the statusbar in the 'Settings' menu.
Definition kxmlguiwindow.h:286
@ Save
Autosaves (and loads) the toolbar/menubar/statusbar settings and window size using the default name.
Definition kxmlguiwindow.h:303
@ Create
Calls createGUI() once ToolBar, Keys and Statusbar have been taken care of.
Definition kxmlguiwindow.h:319
@ Keys
Adds an action in the 'Settings' menu to open the configure keyboard shortcuts dialog.
Definition kxmlguiwindow.h:277
void setupToolbarMenuActions()
Definition kxmlguiwindow.cpp:205
virtual void slotStateChanged(const QString &newstate)
Applies a state change.
Definition kxmlguiwindow.cpp:410
virtual void configureToolbars()
Show a standard configure toolbar dialog.
Definition kxmlguiwindow.cpp:261
bool isCommandBarEnabled() const
Returns whether a KCommandBar was set.
Definition kxmlguiwindow.cpp:562
void setHelpMenuEnabled(bool showHelpMenu=true)
Creates a standard help menu when calling createGUI() or setupGUI().
Definition kxmlguiwindow.cpp:237
bool event(QEvent *event) override
Reimplemented to catch QEvent::Polish in order to adjust the object name if needed,...
Definition kxmlguiwindow.cpp:219
virtual void saveNewToolbarConfig()
Rebuilds the GUI after KEditToolBar changes the toolbar layout.
Definition kxmlguiwindow.cpp:274
void setCommandBarEnabled(bool showCommandBar)
Enable a KCommandBar to list and quickly execute actions.
Definition kxmlguiwindow.cpp:546
void checkAmbiguousShortcuts()
Checks if there are actions using the same shortcut.
Definition kxmlguiwindow.cpp:491
void setupGUI(StandardWindowOptions options=Default, const QString &xmlfile=QString())
Configures the current window and its actions in the typical KDE fashion.
Definition kxmlguiwindow.cpp:285
QString i18n(const char *text, const TYPE &arg...)
void information(QWidget *parent, const QString &text, const QString &title=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
Notify
AllowLink
KToggleAction * showStatusbar(const QObject *recvr, const char *slot, QObject *parent)
bool isEnabled() const const
void setIcon(const QIcon &icon)
void setShortcuts(QKeySequence::StandardKey key)
QList< QKeySequence > shortcuts() const const
text
void toggled(bool checked)
whatsThis
ExportScriptableSlots
bool registerObject(const QString &path, QObject *object, RegisterOptions options)
QDBusConnection sessionBus()
Polish
Type type() const const
QIcon fromTheme(const QString &name)
NativeText
void append(QList< T > &&value)
qsizetype indexOf(const AT &value, qsizetype from) const const
bool isEmpty() const const
qsizetype removeAll(const AT &t)
void reserve(qsizetype size)
qsizetype size() const const
QStatusBar * statusBar() const const
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue) const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
T findChild(const QString &name, Qt::FindChildOptions options) const const
objectName
bool isNull() const const
QString & remove(QChar ch, Qt::CaseSensitivity cs)
void reserve(qsizetype size)
Key_I
CTRL
WA_DeleteOnClose
typedef WindowFlags
QList< QAction * > actions() const const
void adjustSize()
bool isHidden() const const
void resize(const QSize &)
virtual void setVisible(bool visible)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:02:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:02:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.