KXmlGui
kmainwindow.cpp
152 QString localFilePath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + config->name();
325 // Set a unique object name. Required by session management, window management, and for the dbus interface.
375 q->winId(); // workaround for setWindowRole() crashing, and set also window role, just in case TT
376 q->setWindowRole(s); // will keep insisting that object name suddenly should not be used for window role
440 delete static_cast<QObject *>(k_ptr->dockResizeListener); // so we don't get anymore events after k_ptr is destroyed
467 connect(d->helpMenu, &KHelpMenu::showAboutApplication, this, &KMainWindow::showAboutApplication);
495 KConfigGroup group(config, QByteArray(WINDOW_PROPERTIES).append(QByteArray::number(number)).constData());
526 if (!title.contains(QLatin1String("[*]")) && !title.isEmpty()) { // append the placeholder so that the modified mechanism works
611 KConfigGroup cg(config, QByteArray(WINDOW_PROPERTIES).append(QByteArray::number(number)).constData());
676 groupName += (toolbar->objectName().isEmpty() ? QByteArray::number(n) : QByteArray(" ").append(toolbar->objectName().toUtf8()));
696 KConfigGroup cg(config, QByteArray(WINDOW_PROPERTIES).append(QByteArray::number(number)).constData());
739 // NOTICE: QWindow::setGeometry() does NOT impact the backing QWidget geometry even if the platform
772 if (!autoSaveSettings() || cg.name() == autoSaveGroup()) { // TODO should be cg == d->autoSaveGroup, to compare both kconfig and group name
783 groupName += (toolbar->objectName().isEmpty() ? QByteArray::number(n) : QByteArray(" ").append(toolbar->objectName().toUtf8()));
Q_OBJECTQ_OBJECT
void append(const T &value)
virtual bool event(QEvent *event) override
void removeEventFilter(QObject *obj)
KCONFIGGUI_EXPORT void restoreWindowPosition(QWindow *window, const KConfigGroup &config)
QWidget * focusWidget()
void setSettingsDirty()
Tell the main window that it should save its settings when being closed.
Definition: kmainwindow.cpp:820
QString readEntry(const char *key, const char *aDefault=nullptr) const
void setDiscardCommand(const QStringList &command)
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const const
QWidget * window() const const
bool event(QEvent *event) override
Reimplemented to catch QEvent::Polish in order to adjust the object name if needed,...
Definition: kmainwindow.cpp:906
Resize
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
void setFallbackSessionManagementEnabled(bool enabled)
void setFallbackThemeName(const QString &name)
static QList< KMainWindow * > memberList()
List of members of KMainWindow class.
Definition: kmainwindow.cpp:1026
KMainWindow(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Construct a main window.
Definition: kmainwindow.cpp:208
static const QString classNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored.
Definition: kmainwindow.cpp:488
QByteArray & append(char ch)
void setHeight(int arg)
QString dbusName() const
Returns the path under which this window's D-Bus object is exported.
Definition: kmainwindow.cpp:1031
static KGlobalSettings * self()
static void setApplicationData(const KAboutData &aboutData)
KCONFIGGUI_EXPORT void setSessionConfig(const QString &id, const QString &key)
void setStateConfigGroup(const QString &configGroup)
Set the config group name for state config returned by stateConfigGroup If this method is called the ...
Definition: kmainwindow.cpp:883
void restoreWindowSize(const KConfigGroup &config)
For inherited classes.
Definition: kmainwindow.cpp:807
QByteArray number(int n, int base)
void commitDataRequest(QSessionManager &manager)
QString fallbackThemeName()
virtual void readProperties(const KConfigGroup &)
Read your instance-specific properties.
Definition: kmainwindow.h:553
QString writableLocation(QStandardPaths::StandardLocation type)
bool registerObject(const QString &path, QObject *object, QDBusConnection::RegisterOptions options)
void saveWindowSize(KConfigGroup &config) const
For inherited classes.
Definition: kmainwindow.cpp:814
QByteArray toBase64(QByteArray::Base64Options options) const const
KIOFILEWIDGETS_EXPORT QStringList list(const QString &fileClass)
bool restore(int number, bool show=true)
Try to restore the toplevel widget as defined by number (1..X).
Definition: kmainwindow.cpp:503
bool exists() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual void setPlainCaption(const QString &caption)
Make a plain caption without any modifications.
Definition: kmainwindow.cpp:533
virtual void saveGlobalProperties(KConfig *sessionConfig)
Save your application-wide properties.
Definition: kmainwindow.cpp:597
Q_GLOBAL_STATIC(Internal::StaticControl, s_instance) class ControlPrivate
void saveAutoSaveSettings()
This slot should only be called in case you reimplement closeEvent() and if you are using the "auto-s...
Definition: kmainwindow.cpp:895
KConfigGroup autoSaveConfigGroup() const
Definition: kmainwindow.cpp:877
void setWindowRole(const QString &role)
virtual bool eventFilter(QObject *watched, QEvent *event)
virtual void setVisible(bool visible)
typedef WindowFlags
void setWindowModified(bool)
virtual bool queryClose()
Called before the window is closed, either by the user or indirectly by the session manager.
Definition: kmainwindow.cpp:592
void cancel()
QString i18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...)
QMenu * helpMenu(const QString &aboutAppText=QString(), bool showWhatsThis=true)
Retrieve the standard help menu.
Definition: kmainwindow.cpp:444
QString & setNum(short n, int base)
QDBusConnection sessionBus()
QStyle * style() const const
void dockLocationChanged(Qt::DockWidgetArea area)
bool sendEvent(QObject *receiver, QEvent *event)
bool isAccepted() const const
QString sessionKey() const const
static bool canBeRestored(int number)
If the session did contain so high a number, true is returned, else false.
Definition: kmainwindow.cpp:474
void installEventFilter(QObject *filterObj)
void closeEvent(QCloseEvent *) override
Reimplemented to autosave settings and call queryClose().
Definition: kmainwindow.cpp:550
void timeout()
bool isEmpty() const const
FindDirectChildrenOnly
int length() const const
void setWindowTitle(const QString &)
void topLevelChanged(bool topLevel)
QByteArray fromBase64(const QByteArray &base64, QByteArray::Base64Options options)
static KAboutData applicationData()
QMenu * customHelpMenu(bool showWhatsThis=true)
Returns the help menu.
Definition: kmainwindow.cpp:462
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
KCONFIGGUI_EXPORT void saveWindowPosition(const QWindow *window, KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal)
bool hasKey(const char *key) const
KSharedConfigPtr config()
bool testAttribute(Qt::WidgetAttribute attribute) const const
applicationName
virtual int styleHint(QStyle::StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const const=0
void setWidth(int arg)
virtual const QMetaObject * metaObject() const const
void show()
bool restoreState(const QByteArray &state, int version)
T findChild(const QString &name, Qt::FindChildOptions options) const const
static bool toolBarsLocked()
Returns whether the toolbars are locked (i.e., moving of the toobars disallowed).
Definition: ktoolbar.cpp:1459
void revertToDefault(const char *key)
SH_Widget_Animate
void resize(int w, int h)
QWindow * windowHandle() const const
height
GenericConfigLocation
bool hasDefault(const char *key) const
KToolBar * toolBar(const QString &name=QString())
Returns a pointer to the toolbar with the specified name.
Definition: kmainwindow.cpp:996
void showAboutApplication()
This signal is emitted from aboutApplication() if no "about application" string has been defined.
const char * constData() const const
static void setToolBarsLocked(bool locked)
Allows you to lock and unlock all toolbars (i.e., disallow/allow moving of the toobars).
Definition: ktoolbar.cpp:1444
virtual void setCaption(const QString &caption)
Makes a KDE compliant caption (window title).
Definition: kmainwindow.cpp:518
QString left(int n) const const
KCONFIGGUI_EXPORT void restoreWindowSize(QWindow *window, const KConfigGroup &config)
QEvent::Type type() const const
ExportScriptableSlots
objectName
QString name(StandardShortcut id)
void ignore()
bool allowsInteraction()
virtual void saveProperties(KConfigGroup &)
Save your instance-specific properties.
Definition: kmainwindow.h:544
void saveMainWindowSettings(KConfigGroup &config)
Save settings for statusbar, menubar and toolbar to their respective groups in the config group confi...
Definition: kmainwindow.cpp:626
QByteArray saveState(int version) const const
WId winId() const const
void saveStateRequest(QSessionManager &manager)
QString name() const
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
KCONFIGGUI_EXPORT KConfig * sessionConfig()
bool isHidden() const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
KJOBWIDGETS_EXPORT QWidget * window(KJob *job)
width
virtual void readGlobalProperties(KConfig *sessionConfig)
The counterpart of saveGlobalProperties().
Definition: kmainwindow.cpp:601
void setAnimated(bool enabled)
void setFocus()
size
WA_WState_Hidden
QString & append(QChar ch)
KGuiItem discard()
QString sessionId() const const
Q_D(Todo)
ushort unicode() const const
const QObjectList & children() const const
void accept()
KCONFIGGUI_EXPORT void saveWindowSize(const QWindow *window, KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Jan 28 2023 04:11:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Jan 28 2023 04:11:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.