KDEUI
kmainwindow.cpp
Go to the documentation of this file.
240 q->setAnimated(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects);
319 // Set a unique object name. Required by session management, window management, and for the dbus interface.
371 q->winId(); // workaround for setWindowRole() crashing, and set also window role, just in case TT
372 q->setWindowRole( s ); // will keep insisting that object name suddenly should not be used for window role
374 dbusName = '/' + qApp->applicationName() + '/' + q->objectName().replace(QLatin1Char('/'), QLatin1Char('_'));
382 QDBusConnection::sessionBus().registerObject(dbusName, q, QDBusConnection::ExportScriptableSlots |
439 int m = XParseGeometry( cmdlineGeometry.toLatin1(), &x, &y, (unsigned int*)&w, (unsigned int*)&h);
470 delete static_cast<QObject *>(k_ptr->dockResizeListener); //so we don't get anymore events after k_ptr is destroyed
692 if ( !autoSaveSettings() || cg.name() == autoSaveGroup() ) { // TODO should be cg == d->autoSaveGroup, to compare both kconfig and group name
704 group += (toolbar->objectName().isEmpty() ? QString::number(n) : QString(" ")+toolbar->objectName());
779 if ( !autoSaveSettings() || cg.name() == autoSaveGroup() ) { // TODO should be cg == d->autoSaveGroup, to compare both kconfig and group name
792 group += (toolbar->objectName().isEmpty() ? QString::number(n) : QString(" ")+toolbar->objectName());
838 QString geometryKey = QString::fromLatin1("geometry-%1-%2").arg(desk.width()).arg(desk.height());
852 QString geometryKey = QString::fromLatin1("geometry-%1-%2").arg(desk.width()).arg(desk.height());
867 // try first if there data has been stored using the X11-like approach from earlier kdelibs versions.
950 d->defaultWindowSize = QRect(desk.width(), width(), desk.height(), height()); // store default values
958 resize( desk.width(), desk.height() ); // WORKAROUND: this should not be needed. KWindowSystem::setState
1183 q->setAnimated(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects);
static KApplication * kApplication()
Returns the current application object.
Definition: kapplication.cpp:603
KConfig * sessionConfig()
Returns the application session config object.
Definition: kapplication.cpp:608
bool isSet(const QByteArray &option) const
static KCmdLineArgs * parsedArgs(const QByteArray &id=QByteArray())
QString getOption(const QByteArray &option) const
QString name() const
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=0) const
void revertToDefault(const char *key)
static QString makeStandardCaption(const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption)
Builds a caption that contains the application name along with the userCaption using a standard layou...
Definition: kdialog.cpp:442
static KGlobalSettings * self()
Return the KGlobalSettings singleton.
Definition: kglobalsettings.cpp:188
static GraphicEffects graphicEffectsLevel()
This function determines the desired level of effects on the GUI.
Definition: kglobalsettings.cpp:782
void restoreWindowSize(const KConfigGroup &config)
For inherited classes Note that a -geometry on the command line has priority.
Definition: kmainwindow.cpp:831
virtual void applyMainWindowSettings(const KConfigGroup &config, bool forceGlobal=false)
Read settings for statusbar, menubar and toolbar from their respective groups in the config file and ...
Definition: kmainwindow.cpp:746
KToolBar * toolBar(const QString &name=QString())
Returns a pointer to the toolbar with the specified name.
Definition: kmainwindow.cpp:1193
virtual void readGlobalProperties(KConfig *sessionConfig)
The counterpart of saveGlobalProperties().
Definition: kmainwindow.cpp:626
void saveAutoSaveSettings()
This slot should only be called in case you reimplement closeEvent() and if you are using the "auto-s...
Definition: kmainwindow.cpp:1051
KMenu * customHelpMenu(bool showWhatsThis=true)
Returns the help menu.
Definition: kmainwindow.cpp:491
bool restore(int number, bool show=true)
Try to restore the toplevel widget as defined by number (1..X).
Definition: kmainwindow.cpp:534
virtual void saveProperties(KConfigGroup &)
Save your instance-specific properties.
Definition: kmainwindow.h:585
static bool canBeRestored(int number)
If the session did contain so high a number, true is returned, else false.
Definition: kmainwindow.cpp:503
void setSettingsDirty()
Tell the main window that it should save its settings when being closed.
Definition: kmainwindow.cpp:991
KConfigGroup autoSaveConfigGroup() const
Definition: kmainwindow.cpp:1045
virtual void setCaption(const QString &caption)
Makes a KDE compliant caption (window title).
Definition: kmainwindow.cpp:547
void saveWindowSize(const KConfigGroup &config) const
For inherited classes.
Definition: kmainwindow.cpp:845
static QList< KMainWindow * > memberList()
List of members of KMainWindow class.
Definition: kmainwindow.cpp:1218
static const QString classNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored.
Definition: kmainwindow.cpp:516
virtual void setPlainCaption(const QString &caption)
Make a plain caption without any modifications.
Definition: kmainwindow.cpp:564
bool readPropertiesInternal(KConfig *, int)
Definition: kmainwindow.cpp:712
void saveMainWindowSettings(const KConfigGroup &config)
Save settings for statusbar, menubar and toolbar to their respective groups in the config group confi...
Definition: kmainwindow.cpp:659
virtual bool event(QEvent *event)
Reimplemented to catch QEvent::Polish in order to adjust the object name if needed,...
Definition: kmainwindow.cpp:1061
KMainWindow(QWidget *parent=0, Qt::WindowFlags f=KDE_DEFAULT_WINDOWFLAGS)
Construct a main window.
Definition: kmainwindow.cpp:217
virtual void readProperties(const KConfigGroup &)
Read your instance-specific properties.
Definition: kmainwindow.h:592
virtual void closeEvent(QCloseEvent *)
Reimplemented to call the queryClose() and queryExit() handlers.
Definition: kmainwindow.cpp:580
virtual void saveGlobalProperties(KConfig *sessionConfig)
Save your application-wide properties.
Definition: kmainwindow.cpp:622
void parseGeometry(bool parsewidth)
parse the geometry from the geometry command line argument
Definition: kmainwindow.cpp:424
QString dbusName() const
Returns the path under which this window's D-Bus object is exported.
Definition: kmainwindow.cpp:1220
void setAutoSaveSettings(const QString &groupName=QLatin1String("MainWindow"), bool saveWindowSize=true)
Call this to enable "auto-save" of toolbar/menubar/statusbar settings (and optionally window size).
Definition: kmainwindow.cpp:1003
void savePropertiesInternal(KConfig *, int)
Definition: kmainwindow.cpp:634
KMenu * helpMenu(const QString &aboutAppText=QString(), bool showWhatsThis=true)
Retrieve the standard help menu.
Definition: kmainwindow.cpp:475
virtual bool queryClose()
Called before the window is closed, either by the user or indirectly by the session manager.
Definition: kmainwindow.cpp:617
Provides highlevel access to session management on a per-object base.
Definition: ksessionmanager.h:46
void applySettings(const KConfigGroup &cg, bool forceGlobal=false)
Read the toolbar settings from group configGroup in config and apply them.
Definition: ktoolbar.cpp:1041
static bool toolBarsLocked()
Returns whether the toolbars are locked (i.e., moving of the toobars disallowed).
Definition: ktoolbar.cpp:1430
static void setToolBarsLocked(bool locked)
Allows you to lock and unlock all toolbars (i.e., disallow/allow moving of the toobars).
Definition: ktoolbar.cpp:1417
void saveSettings(KConfigGroup &cg)
Save the toolbar settings to group configGroup in config.
Definition: ktoolbar.cpp:828
unsigned long state() const
Returns the window's state flags (see the NET::State enum for details).
Definition: kwindowinfo_mac.cpp:175
static void setState(WId win, unsigned long state)
Sets the state of window win to state.
Definition: kwindowsystem_mac.cpp:506
static KWindowInfo windowInfo(WId win, unsigned long properties, unsigned long properties2=0)
Returns information about window win.
Definition: kwindowsystem_mac.cpp:330
#define K_GLOBAL_STATIC(TYPE, NAME)
#define kDebug
int timeout
static bool isValidDBusObjectPathCharacter(const QChar &c)
Definition: kmainwindow.cpp:308
static KStatusBar * internalStatusBar(KMainWindow *mw)
Definition: kmainwindow.cpp:81
void setAllowQuit(bool allowQuit)
const KComponentData & mainComponent()
void deref()
void ref()
QString caption()
KSharedConfigPtr config()
group
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.