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);
const char * className() const
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
QString caption()
bool isMaximized() const
KMenu * helpMenu(const QString &aboutAppText=QString(), bool showWhatsThis=true)
Retrieve the standard help menu.
Definition: kmainwindow.cpp:475
const QRect screenGeometry(int screen) const
Type type() const
bool isHidden() const
void setSettingsDirty()
Tell the main window that it should save its settings when being closed.
Definition: kmainwindow.cpp:991
int width() 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:1417
void savePropertiesInternal(KConfig *, int)
Definition: kmainwindow.cpp:634
QWidget * window() const
virtual bool event(QEvent *event)
Reimplemented to catch QEvent::Polish in order to adjust the object name if needed, once all constructor code for the main window has run.
Definition: kmainwindow.cpp:1061
virtual bool saveState(QSessionManager &sm)
See QApplication::saveState() for documentation.
Definition: ksessionmanager.cpp:35
void saveSettings(KConfigGroup &cg)
Save the toolbar settings to group configGroup in config.
Definition: ktoolbar.cpp:828
bool isEmpty() const
void setWindowRole(const QString &role)
bool hasDefault(const QString &key) const
int timeout
static KCmdLineArgs * parsedArgs(const QByteArray &id=QByteArray())
QString & prepend(QChar ch)
KMenu * customHelpMenu(bool showWhatsThis=true)
Returns the help menu.
Definition: kmainwindow.cpp:491
#define K_GLOBAL_STATIC(TYPE, NAME)
static KWindowInfo windowInfo(WId win, unsigned long properties, unsigned long properties2=0)
Returns information about window win.
Definition: kwindowsystem_mac.cpp:330
const QObjectList & children() const
void saveWindowSize(const KConfigGroup &config) const
For inherited classes.
Definition: kmainwindow.cpp:845
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
int y() const
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
virtual const QMetaObject * metaObject() const
QString autoSaveGroup() const
void resetAutoSaveSettings()
Disable the auto-save-settings feature.
Definition: kmainwindow.cpp:1024
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
bool isTopLevel() const
int height() const
int x() const
int y() const
QDBusConnection sessionBus()
const KAboutData * aboutData() const
unsigned long state() const
Returns the window's state flags (see the NET::State enum for details).
Definition: kwindowinfo_mac.cpp:175
static KGlobalSettings * self()
Return the KGlobalSettings singleton.
Definition: kglobalsettings.cpp:188
static const QString classNameOfToplevel(int number)
Returns the className() of the number of the toplevel window which should be restored.
Definition: kmainwindow.cpp:516
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
int screenNumber(const QWidget *widget) const
void ref()
static KApplication * kApplication()
Returns the current application object.
Definition: kapplication.cpp:603
bool isSet(const QByteArray &option) const
void setStatusBar(QStatusBar *statusbar)
static bool isValidDBusObjectPathCharacter(const QChar &c)
Definition: kmainwindow.cpp:308
const QRect & geometry() const
KSharedConfigPtr config()
bool isNull() const
void restoreWindowSize(const KConfigGroup &config)
For inherited classes Note that a -geometry on the command line has priority.
Definition: kmainwindow.cpp:831
bool restore(int number, bool show=true)
Try to restore the toplevel widget as defined by number (1..X).
Definition: kmainwindow.cpp:534
Definition: kdialog.h:444
int width() const
void resize(int w, int h)
virtual void setPlainCaption(const QString &caption)
Make a plain caption without any modifications.
Definition: kmainwindow.cpp:564
void setWindowState(QFlags< Qt::WindowState > windowState)
QSize minimumSize() const
const char * name() const
virtual void saveGlobalProperties(KConfig *sessionConfig)
Save your application-wide properties.
Definition: kmainwindow.cpp:622
void setAnimated(bool enabled)
bool testAttribute(Qt::WidgetAttribute attribute) const
QString number(int n, int base)
virtual void readProperties(const KConfigGroup &)
Read your instance-specific properties.
Definition: kmainwindow.h:592
Provides highlevel access to session management on a per-object base.
Definition: ksessionmanager.h:45
void append(const T &value)
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
bool isAccepted() const
void ignore()
void deref()
void installEventFilter(QObject *filterObj)
void setMenuBar(QMenuBar *menuBar)
int x() const
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
bool restoreGeometry(const QByteArray &geometry)
void setFocus()
virtual bool event(QEvent *event)
objectName
bool isEmpty() const
QWidget * focusWidget()
Definition: kdialog.h:445
void setAllowQuit(bool allowQuit)
bool sendEvent(QObject *receiver, QEvent *event)
virtual bool queryExit()
Called before the very last window is closed, either by the user or indirectly by the session manager...
Definition: kmainwindow.cpp:612
void move(int x, int y)
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
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
static KStatusBar * internalStatusBar(KMainWindow *mw)
Definition: kmainwindow.cpp:81
virtual bool eventFilter(QObject *watched, QEvent *event)
bool autoSaveSettings() const
static bool canBeRestored(int number)
If the session did contain so high a number, true is returned, else false.
Definition: kmainwindow.cpp:503
bool readPropertiesInternal(KConfig *, int)
Definition: kmainwindow.cpp:712
WId winId() const
virtual bool queryClose()
Called before the window is closed, either by the user or indirectly by the session manager...
Definition: kmainwindow.cpp:617
void hide()
ushort unicode() const
bool allowsInteraction()
virtual void closeEvent(QCloseEvent *)
Reimplemented to call the queryClose() and queryExit() handlers.
Definition: kmainwindow.cpp:580
virtual void setCaption(const QString &caption)
Makes a KDE compliant caption (window title).
Definition: kmainwindow.cpp:547
virtual bool commitData(QSessionManager &sm)
See QApplication::commitData() for documentation.
Definition: ksessionmanager.cpp:40
void accept()
static void setState(WId win, unsigned long state)
Sets the state of window win to state.
Definition: kwindowsystem_mac.cpp:506
bool initialGeometrySet() const
void applySettings(const KConfigGroup &cg, bool forceGlobal=false)
Read the toolbar settings from group configGroup in config and apply them.
Definition: ktoolbar.cpp:1041
QString name() const
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
QByteArray saveState(int version) const
void parseGeometry(bool parsewidth)
parse the geometry from the geometry command line argument
Definition: kmainwindow.cpp:424
bool hasKey(const QString &key) const
QSize maximumSize() const
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
QByteArray toLatin1() const
int width() const
QByteArray saveGeometry() const
QDesktopWidget * desktop()
QByteArray fromBase64(const QByteArray &base64)
KMainWindow(QWidget *parent=0, Qt::WindowFlags f=KDE_DEFAULT_WINDOWFLAGS)
Construct a main window.
Definition: kmainwindow.cpp:217
QString & setNum(short n, int base)
void setWindowTitle(const QString &)
KToolBar * toolBar(const QString &name=QString())
Returns a pointer to the toolbar with the specified name.
Definition: kmainwindow.cpp:1193
QString dbusName() const
Returns the path under which this window's D-Bus object is exported.
Definition: kmainwindow.cpp:1220
bool restoreState(const QByteArray &state, int version)
int height() const
const KComponentData & mainComponent()
int length() const
QString left(int n) const
QString fromLatin1(const char *str, int size)
QString getOption(const QByteArray &option) const
typedef WindowFlags
KConfig * sessionConfig()
Returns the application session config object.
Definition: kapplication.cpp:608
void show()
QByteArray toBase64() const
static GraphicEffects graphicEffectsLevel()
This function determines the desired level of effects on the GUI.
Definition: kglobalsettings.cpp:782
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
T readEntry(const QString &key, const T &aDefault) const
virtual void readGlobalProperties(KConfig *sessionConfig)
The counterpart of saveGlobalProperties().
Definition: kmainwindow.cpp:626
void revertToDefault(const QString &key)
Definition: netwm_def.h:635
virtual void saveProperties(KConfigGroup &)
Save your instance-specific properties.
Definition: kmainwindow.h:585
GUI with simple animations enabled.
Definition: kglobalsettings.h:467
void removeEventFilter(QObject *obj)
int height() const
static QList< KMainWindow * > memberList()
List of members of KMainWindow class.
Definition: kmainwindow.cpp:1218
static bool toolBarsLocked()
Returns whether the toolbars are locked (i.e., moving of the toobars disallowed). ...
Definition: ktoolbar.cpp:1430
KConfigGroup autoSaveConfigGroup() const
Definition: kmainwindow.cpp:1045
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.