KXmlGui
kmainwindow.cpp
149 QString localFilePath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + config->name();
302 // Set a unique object name. Required by session management, window management, and for the dbus interface.
352 q->winId(); // workaround for setWindowRole() crashing, and set also window role, just in case TT
353 q->setWindowRole(s); // will keep insisting that object name suddenly should not be used for window role
417 delete static_cast<QObject *>(d_ptr->dockResizeListener); // so we don't get anymore events after d_ptr is destroyed
472 if (!title.contains(QLatin1String("[*]")) && !title.isEmpty()) { // append the placeholder so that the modified mechanism works
684 // NOTICE: QWindow::setGeometry() does NOT impact the backing QWidget geometry even if the platform
717 if (!autoSaveSettings() || cg.name() == autoSaveGroup()) { // TODO should be cg == d->autoSaveGroup, to compare both kconfig and group name
896 if (KStandardShortcut::openContextMenu().contains(QKeySequence(keyEvent->key() | keyEvent->modifiers()))) {
898 const QPoint centerOfWidget(widgetWithKeyboardFocus->width() / 2, widgetWithKeyboardFocus->height() / 2);
900 new QContextMenuEvent(QContextMenuEvent::Keyboard, centerOfWidget, widgetWithKeyboardFocus->mapToGlobal(centerOfWidget)));
904 qApp->postEvent(qApp->focusObject(), new QContextMenuEvent(QContextMenuEvent::Keyboard, mapFromGlobal(QCursor::pos()), QCursor::pos()));
static void setApplicationData(const KAboutData &aboutData)
static KAboutData applicationData()
QString name() const
void revertToDefault(const char *key, WriteConfigFlags pFlag=WriteConfigFlags())
bool hasDefault(const char *key) const
bool hasKey(const char *key) const
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
QString readEntry(const char *key, const char *aDefault=nullptr) const
bool sync() override
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:660
bool restore(int numberOfInstances, bool show=true)
Attempt to restore the top-level widget as defined by numberOfInstances (1..X).
Definition kmainwindow.cpp:449
KToolBar * toolBar(const QString &name=QString())
This is useful to both call specific toolbars that have been created or to generate a default one upo...
Definition kmainwindow.cpp:943
virtual void readGlobalProperties(KConfig *sessionConfig)
Reads your application-wide properties.
Definition kmainwindow.cpp:547
bool event(QEvent *event) override
Reimplemented to catch QEvent::Polish in order to adjust the object name if needed,...
Definition kmainwindow.cpp:836
void saveAutoSaveSettings()
This slot should only be called in case you reimplement closeEvent() and if you are using the autosav...
Definition kmainwindow.cpp:825
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 closeEvent(QCloseEvent *) override
Reimplemented to autosave settings and call queryClose().
Definition kmainwindow.cpp:496
virtual void saveProperties(KConfigGroup &)
Saves your instance-specific properties.
Definition kmainwindow.h:540
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
static const QString classNameOfToplevel(int instanceNumber)
Useful if your application uses different kinds of top-level windows.
Definition kmainwindow.cpp:434
virtual void setCaption(const QString &caption)
Assigns a KDE compliant caption (window title).
Definition kmainwindow.cpp:464
virtual void setPlainCaption(const QString &caption)
Make a plain caption without any modifications.
Definition kmainwindow.cpp:479
void setStateConfigGroup(const QString &configGroup)
Assigns the config group name for the KConfigGroup returned by stateConfigGroup.
Definition kmainwindow.cpp:813
KMainWindow(QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
Constructs a main window.
Definition kmainwindow.cpp:207
virtual void readProperties(const KConfigGroup &)
Reads your instance-specific properties.
Definition kmainwindow.h:560
virtual void saveGlobalProperties(KConfig *sessionConfig)
Saves your application-wide properties.
Definition kmainwindow.cpp:543
static bool canBeRestored(int numberOfInstances)
Definition kmainwindow.cpp:420
void keyPressEvent(QKeyEvent *keyEvent) override
Reimplemented to open context menus on Shift+F10.
Definition kmainwindow.cpp:894
virtual bool queryClose()
This function is called before the window is closed, either by the user or indirectly by the session ...
Definition kmainwindow.cpp:538
static bool toolBarsLocked()
Returns whether the toolbars are locked (i.e., moving of the toobars disallowed).
Definition ktoolbar.cpp:1467
static void setToolBarsLocked(bool locked)
Allows you to lock and unlock all toolbars (i.e., disallow/allow moving of the toobars).
Definition ktoolbar.cpp:1452
QString i18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...)
KCONFIGGUI_EXPORT void setSessionConfig(const QString &id, const QString &key)
KCONFIGGUI_EXPORT KConfig * sessionConfig()
KGUIADDONS_EXPORT QWindow * window(QObject *job)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
QString name(StandardAction id)
KGuiItem discard()
const QList< QKeySequence > & openContextMenu()
KCONFIGGUI_EXPORT void saveWindowSize(const QWindow *window, KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal)
KCONFIGGUI_EXPORT void saveWindowPosition(const QWindow *window, KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal)
KCONFIGGUI_EXPORT void restoreWindowSize(QWindow *window, const KConfigGroup &config)
KCONFIGGUI_EXPORT void restoreWindowPosition(QWindow *window, const KConfigGroup &config)
QWidget * focusWidget()
QByteArray fromBase64(const QByteArray &base64, Base64Options options)
QByteArray toBase64(Base64Options options) const const
char16_t & unicode()
applicationName
bool sendEvent(QObject *receiver, QEvent *event)
QPoint pos()
ExportScriptableSlots
bool registerObject(const QString &path, QObject *object, RegisterOptions options)
QDBusConnection sessionBus()
void dockLocationChanged(Qt::DockWidgetArea area)
void topLevelChanged(bool topLevel)
Resize
void accept()
bool isAccepted() const const
void ignore()
Type type() const const
bool exists() const const
void commitDataRequest(QSessionManager &manager)
void saveStateRequest(QSessionManager &manager)
void append(QList< T > &&value)
void setAnimated(bool enabled)
virtual bool event(QEvent *event) override
bool restoreState(const QByteArray &state, int version)
QByteArray saveState(int version) const const
Q_OBJECTQ_OBJECT
const QObjectList & children() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
virtual bool event(QEvent *e)
virtual bool eventFilter(QObject *watched, QEvent *event)
T findChild(const QString &name, Qt::FindChildOptions options) const const
void installEventFilter(QObject *filterObj)
virtual const QMetaObject * metaObject() const const
objectName
T qobject_cast(QObject *object)
void removeEventFilter(QObject *obj)
void setObjectName(QAnyStringView name)
bool allowsInteraction()
void cancel()
QString sessionId() const const
QString sessionKey() const const
void setDiscardCommand(const QStringList &command)
GenericConfigLocation
QString writableLocation(StandardLocation type)
QString & append(QChar ch)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
QString left(qsizetype n) const const
qsizetype length() const const
QString number(double n, char format, int precision)
QString & setNum(double n, char format, int precision)
SH_Widget_Animate
virtual int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const const=0
FindDirectChildrenOnly
WA_WState_Hidden
typedef WindowFlags
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void timeout()
QWidget * focusWidget() const const
height
bool isHidden() const const
virtual void keyPressEvent(QKeyEvent *event)
QPoint mapFromGlobal(const QPoint &pos) const const
void setFocus()
void setWindowRole(const QString &role)
void show()
void resize(const QSize &)
QStyle * style() const const
virtual void setVisible(bool visible)
width
WId winId() const const
QWidget * window() const const
QWindow * windowHandle() const const
void setWindowModified(bool)
void setWindowTitle(const QString &)
void setHeight(int arg)
void setWidth(int arg)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.