KApplication Class Reference
Controls and provides information to all KDE applications. Controls and provides information to all KDE applications. More...
#include <kapplication.h>
Inheritance diagram for KApplication:


Public Types | |
enum | CaptionLayout { CaptionAppLast = 1, CaptionAppFirst, CaptionNoApp } |
enum | ShutdownConfirm { ShutdownConfirmDefault = -1, ShutdownConfirmNo = 0, ShutdownConfirmYes = 1 } |
enum | ShutdownType { ShutdownTypeDefault = -1, ShutdownTypeNone = 0, ShutdownTypeReboot = 1, ShutdownTypeHalt = 2 } |
enum | ShutdownMode { ShutdownModeDefault = -1, ShutdownModeSchedule = 0, ShutdownModeTryNow = 1, ShutdownModeForceNow = 2, ShutdownModeInteractive = 3 } |
enum | { ShiftModifier = 1<<0, LockModifier = 1<<1, ControlModifier = 1<<2, Modifier1 = 1<<3, Modifier2 = 1<<4, Modifier3 = 1<<5, Modifier4 = 1<<6, Modifier5 = 1<<7 } |
enum | { Button1Pressed = 1<<8, Button2Pressed = 1<<9, Button3Pressed = 1<<10, Button4Pressed = 1<<11, Button5Pressed = 1<<12 } |
enum | SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS, SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS } |
Public Slots | |
void | invokeBrowser (const QString &url, const QCString &startup_id) |
void | invokeBrowser (const QString &url) |
void | cut () |
void | copy () |
void | paste () |
void | clear () |
void | selectAll () |
void | ref () |
void | deref () |
Signals | |
void | kdisplayPaletteChanged () |
void | kdisplayStyleChanged () |
void | kdisplayFontChanged () |
void | appearanceChanged () |
void | toolbarAppearanceChanged (int) |
void | backgroundChanged (int desk) |
void | settingsChanged (int category) |
void | iconChanged (int group) |
void | kipcMessage (int id, int data) |
void | saveYourself () |
void | shutDown () |
Public Member Functions | |
KApplication (bool allowStyles=true, bool GUIenabled=true) | |
KApplication (Display *display, int &argc, char **argv, const QCString &rAppName, bool allowStyles=true, bool GUIenabled=true) | |
KApplication (int &argc, char **argv, const QCString &rAppName, bool allowStyles=true, bool GUIenabled=true) KDE_DEPRECATED | |
KConfig * | sessionConfig () |
bool | isRestored () const |
void | disableSessionManagement () |
void | enableSessionManagement () |
bool | requestShutDown (ShutdownConfirm confirm=ShutdownConfirmDefault, ShutdownType sdtype=ShutdownTypeDefault, ShutdownMode sdmode=ShutdownModeDefault) |
void | propagateSessionManager () |
void | commitData (QSessionManager &sm) |
void | saveState (QSessionManager &sm) |
bool | sessionSaving () const |
QPixmap | icon () const |
QString | iconName () const |
QPixmap | miniIcon () const |
QString | miniIconName () const |
void | setTopWidget (QWidget *topWidget) |
void | invokeHelp (const QString &anchor, const QString &appname, const QCString &startup_id) const |
void | invokeHelp (const QString &anchor=QString::null, const QString &appname=QString::null) const |
void | invokeHTMLHelp (const QString &aFilename, const QString &aTopic=QString::null) const KDE_DEPRECATED |
void | invokeMailer (const QString &address, const QString &subject, const QCString &startup_id) |
void | invokeMailer (const QString &address, const QString &subject) |
void | invokeMailer (const KURL &mailtoURL, const QCString &startup_id) |
void | invokeMailer (const KURL &mailtoURL) |
void | invokeMailer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, const QString &messageFile, const QStringList &attachURLs, const QCString &startup_id) |
void | invokeMailer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, const QString &messageFile=QString::null, const QStringList &attachURLs=QStringList()) |
QString | caption () const |
KDE_DEPRECATED KStyle * | kstyle () const |
QString | makeStdCaption (const QString &userCaption, bool withAppName=true, bool modified=false) const |
QString | tempSaveName (const QString &pFilename) const |
QString | checkRecoverFile (const QString &pFilename, bool &bRecover) const |
void | enableStyles () |
void | disableStyles () |
void | installX11EventFilter (QWidget *filter) |
void | removeX11EventFilter (const QWidget *filter) |
void | addKipcEventMask (int id) |
void | removeKipcEventMask (int id) |
QCString | startupId () const |
void | setStartupId (const QCString &startup_id) |
void | updateUserTimestamp (unsigned long time=0) |
QString | geometryArgument () const |
void | installKDEPropertyMap () |
bool | authorize (const QString &genericAction) |
bool | authorizeKAction (const char *action) |
bool | authorizeURLAction (const QString &action, const KURL &baseURL, const KURL &destURL) |
void | allowURLAction (const QString &action, const KURL &_baseURL, const KURL &_destURL) |
bool | authorizeControlModule (const QString &menuId) |
QStringList | authorizeControlModules (const QStringList &menuIds) |
bool | notify (QObject *receiver, QEvent *event) |
int | xErrhandler (Display *, void *) |
int | xioErrhandler (Display *) |
void | iceIOErrorHandler (_IceConn *conn) |
Static Public Member Functions | |
void | addCmdLineOptions () |
KApplication * | kApplication () |
DCOPClient * | dcopClient () |
void | disableAutoDcopRegistration () |
QCString | launcher () |
int | startServiceByName (const QString &_name, const QString &URL, QString *error=0, QCString *dcopService=0, int *pid=0, const QCString &startup_id="", bool noWait=false) |
int | startServiceByName (const QString &_name, const QStringList &URLs=QStringList(), QString *error=0, QCString *dcopService=0, int *pid=0, const QCString &startup_id="", bool noWait=false) |
int | startServiceByDesktopPath (const QString &_name, const QString &URL, QString *error=0, QCString *dcopService=0, int *pid=0, const QCString &startup_id="", bool noWait=false) |
int | startServiceByDesktopPath (const QString &_name, const QStringList &URLs=QStringList(), QString *error=0, QCString *dcopService=0, int *pid=0, const QCString &startup_id="", bool noWait=false) |
int | startServiceByDesktopName (const QString &_name, const QString &URL, QString *error=0, QCString *dcopService=0, int *pid=0, const QCString &startup_id="", bool noWait=false) |
int | startServiceByDesktopName (const QString &_name, const QStringList &URLs=QStringList(), QString *error=0, QCString *dcopService=0, int *pid=0, const QCString &startup_id="", bool noWait=false) |
int | kdeinitExec (const QString &name, const QStringList &args, QString *error, int *pid, const QCString &startup_id) |
int | kdeinitExec (const QString &name, const QStringList &args=QStringList(), QString *error=0, int *pid=0) |
int | kdeinitExecWait (const QString &name, const QStringList &args, QString *error, int *pid, const QCString &startup_id) |
int | kdeinitExecWait (const QString &name, const QStringList &args=QStringList(), QString *error=0, int *pid=0) |
int | random () |
QString | randomString (int length) |
uint | keyboardModifiers () |
uint | mouseState () |
void | startKdeinit () |
QPalette | createApplicationPalette () |
QPalette | createApplicationPalette (KConfig *config, int contrast) |
void | installSigpipeHandler () |
bool | guiEnabled () |
Static Public Attributes | |
bool | loadedByKdeinit = false |
Protected Member Functions | |
KApplication (bool allowStyles, bool GUIenabled, KInstance *_instance) | |
void | invokeEditSlot (const char *slot) |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
Atom | kipcCommAtom |
int | kipcEventMask |
int | pArgc |
Static Protected Attributes | |
KApplication * | KApp = 0L |
Detailed Description
Controls and provides information to all KDE applications. Controls and provides information to all KDE applications.Only one object of this class can be instantiated in a single app. This instance is always accessible via the kApplication() method.
This class provides the following services to all KDE applications.
- It controls the event queue (see QApplication ).
- It provides the application with KDE resources such as accelerators, common menu entries, a KConfig object. session management events, help invocation etc.
- Installs a signal handler for the SIGCHLD signal in order to avoid zombie children. If you want to catch this signal yourself or don't want it to be caught at all, you have set a new signal handler (or SIG_IGN) after KApplication's constructor has run.
- Installs an empty signal handler for the SIGPIPE signal using installSigpipeHandler(). If you want to catch this signal yourself, you have set a new signal handler after KApplication's constructor has run.
- It can start new services
There are three possibilities:
- X-DCOP-ServiceType=None (default) Always start a new service, don't wait till the service registers with dcop.
- X-DCOP-ServiceType=Multi Always start a new service, wait until the service has registered with dcop.
- X-DCOP-ServiceType=Unique Only start the service if it isn't already running, wait until the service has registered with dcop.
- Author:
- Matthias Kalle Dalheimer <kalle@kde.org>
- Version:
- Id
- kapplication.h,v 1.306 2004/01/07 12:16:15 waba Exp
Definition at line 96 of file kapplication.h.
Member Enumeration Documentation
|
The possible values for the
Definition at line 231 of file kapplication.h. |
|
The possible values for the
Definition at line 249 of file kapplication.h. |
|
The possible values for the
Definition at line 271 of file kapplication.h. |
|
Valid values for the settingsChanged signal.
Definition at line 1160 of file kapplication.h. |
Constructor & Destructor Documentation
|
This constructor takes aboutData and command line arguments from KCmdLineArgs.
Definition at line 572 of file kapplication.cpp. References installSigpipeHandler(), and KInstance::instanceName(). |
|
Constructor. Parses command-line arguments. Use this constructor to use KApplication in a Motif or Xt program.
|
|
Definition at line 550 of file kapplication.cpp. References installSigpipeHandler(), QCString::isEmpty(), and QApplication::Q_ASSERT(). |
Member Function Documentation
|
Add Qt and KDE command line options to KCmdLineArgs.
Reimplemented in KUniqueApplication. Definition at line 1342 of file kapplication.cpp. References KCmdLineArgs::addCmdLineOptions(). Referenced by KCmdLineArgs::init(). |
|
Returns the current application object. This is similar to the global QApplication pointer qApp. It allows access to the single global KApplication object, since more than one cannot be created in the same application. It saves you the trouble of having to pass the pointer explicitly to every function that may require it.
Definition at line 191 of file kapplication.h. References KApp. |
|
Returns the application session config object.
Definition at line 919 of file kapplication.cpp. |
|
Is the application restored from the session manager?
Definition at line 210 of file kapplication.h. References QApplication::isSessionRestored(). |
|
Disables session management for this application. Useful in case your application is started by the initial "startkde" script. Definition at line 965 of file kapplication.cpp. |
|
Enables again session management for this application, formerly disabled by calling disableSessionManagement(). You usually shouldn't call this function, as the session management is enabled by default. Definition at line 969 of file kapplication.cpp. |
|
Asks the session manager to shut the session down.
Using
Definition at line 991 of file kapplication.cpp. References dcopClient(), QCString::isEmpty(), propagateSessionManager(), DCOPClient::send(), ShutdownConfirmNo, ShutdownConfirmYes, ShutdownModeDefault, ShutdownTypeDefault, and QApplication::syncX(). |
|
Propagates the network address of the session manager in the SESSION_MANAGER environment variable so that child processes can pick it up. If SESSION_MANAGER isn't defined yet, the address is searched in $HOME/.KSMserver. This function is called by clients that are started outside the session ( i.e. before ksmserver is started), but want to launch other processes that should participate in the session. Examples are kdesktop or kicker. Definition at line 1054 of file kapplication.cpp. References QFile::close(), QFile::encodeName(), QCString::find(), QCString::isEmpty(), QFileInfo::lastModified(), QString::latin1(), QFile::open(), QTextStream::readLine(), QCString::replace(), and QTextStream::setEncoding(). Referenced by requestShutDown(). |
|
Returns true if the application is currently saving its session data (most probably before KDE logout). This is intended for use mainly in KMainWindow::queryClose() and KMainWindow::queryExit().
Definition at line 1227 of file kapplication.cpp. |
|
Returns a pointer to a DCOPClient for the application. If a client does not exist yet, it is created when this function is called.
Definition at line 869 of file kapplication.cpp. References KCmdLineArgs::getOption(), KCmdLineArgs::isSet(), KCmdLineArgs::parsedArgs(), DCOPClient::setMainClient(), and DCOPClient::setServerAddress(). Referenced by invokeHelp(), invokeHTMLHelp(), requestShutDown(), and KUniqueApplication::start(). |
|
Disable automatic dcop registration Must be called before creating a KApplication instance to have an effect.
Definition at line 914 of file kapplication.cpp. |
|
Returns a QPixmap with the application icon.
Definition at line 1450 of file kapplication.cpp. References aIconPixmap, KInstance::instanceName(), and QPixmap::isNull(). Referenced by setTopWidget(). |
|
Returns the name of the application icon.
Definition at line 1459 of file kapplication.cpp. References KInstance::instanceName(), and QString::isNull(). |
|
Returns the mini-icon for the application as a QPixmap.
Definition at line 1464 of file kapplication.cpp. References aMiniIconPixmap, KInstance::instanceName(), and QPixmap::isNull(). Referenced by setTopWidget(). |
|
Returns the name of the mini-icon for the application.
Definition at line 1473 of file kapplication.cpp. References KInstance::instanceName(), and QString::isNull(). |
|
Sets the top widget of the application. This means basically applying the right window caption and icon. An application may have several top widgets. You don't need to call this function manually when using KMainWindow.
Definition at line 2542 of file kapplication.cpp. References KCmdLineArgs::appName(), caption(), icon(), miniIcon(), QWidget::setCaption(), QWidget::setIcon(), KWin::setIcons(), KStartupInfo::setWindowStartupId(), startupId(), and QWidget::winId(). |
|
Invokes the KHelpCenter HTML help viewer from docbook sources.
Definition at line 2044 of file kapplication.cpp. References QString::arg(), dcopClient(), endl(), DCOPClient::isApplicationRegistered(), QString::isEmpty(), KStdAction::name(), and startServiceByDesktopName(). |
|
Definition at line 2073 of file kapplication.cpp. References QString::arg(), dcopClient(), endl(), DCOPClient::isApplicationRegistered(), QString::isEmpty(), KStdAction::name(), and startServiceByDesktopName(). |
|
Convenience method; invokes the standard email application.
Definition at line 2109 of file kapplication.cpp. Referenced by invokeMailer(). |
|
Invokes the standard email application.
Definition at line 2120 of file kapplication.cpp. References KURL::decode_string(), invokeMailer(), QString::mid(), KURL::path(), KURL::query(), QStringList::split(), and QString::startsWith(). |
|
Convenience method; invokes the standard email application. All parameters are optional.
Definition at line 2153 of file kapplication.cpp. References KInstance::config(), endl(), QString::endsWith(), KMacroExpander::expandMacros(), QString::fromLatin1(), QString::insert(), QMap::insert(), QString::isEmpty(), kdeinitExec(), KConfigBase::readBoolEntry(), KConfigBase::readEntry(), KConfigBase::readPathEntry(), QString::remove(), KConfigBase::setGroup(), and KShell::splitArgs(). |
|
Invokes the standard browser. Note that you should only do this when you know for sure that the browser can handle the URL (i.e. its mimetype). In doubt, if the URL can point to an image or anything else than directory or HTML, prefer to use new KRun( url ).
Definition at line 2231 of file kapplication.cpp. References endl(), and startServiceByDesktopName(). |
|
If the widget with focus provides a cut() slot, call that slot. Thus for a simple application cut can be implemented as: KStdAction::cut( kapp, SLOT( cut() ), actionCollection() ); Definition at line 2242 of file kapplication.cpp. References invokeEditSlot(). |
|
If the widget with focus provides a copy() slot, call that slot. Thus for a simple application copy can be implemented as: KStdAction::copy( kapp, SLOT( copy() ), actionCollection() ); Definition at line 2247 of file kapplication.cpp. References invokeEditSlot(). |
|
If the widget with focus provides a paste() slot, call that slot. Thus for a simple application copy can be implemented as: KStdAction::paste( kapp, SLOT( paste() ), actionCollection() ); Definition at line 2252 of file kapplication.cpp. References invokeEditSlot(). |
|
If the widget with focus provides a clear() slot, call that slot. Thus for a simple application clear() can be implemented as: Note that for some widgets, this may not provide the intended bahavior. For example if you make use of the code above and a KListView has the focus, clear() will clear all of the items in the list. If this is not the intened behavior and you want to make use of this slot, you can subclass KListView and reimplement this slot. For example the following code would implement a KListView without this behavior:
class MyListView : public KListView { Q_OBJECT public: MyListView( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ) : KListView( parent, name, f ) {} virtual ~MyListView() {} public slots: virtual void clear() {} }; Definition at line 2257 of file kapplication.cpp. References invokeEditSlot(). |
|
If the widget with focus provides a selectAll() slot, call that slot. Thus for a simple application select all can be implemented as: KStdAction::selectAll( kapp, SLOT( selectAll() ), actionCollection() ); Definition at line 2262 of file kapplication.cpp. References invokeEditSlot(). |
|
Returns the DCOP name of the service launcher. This will be something like klaucher_$host_$uid.
Definition at line 2268 of file kapplication.cpp. |
|
Starts a service based on the (translated) name of the service. E.g. "Web Browser"
Definition at line 2350 of file kapplication.cpp. References QString::isEmpty(). |
|
Starts a service based on the (translated) name of the service. E.g. "Web Browser"
Definition at line 2362 of file kapplication.cpp. |
|
Starts a service based on the desktop path of the service. E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop"
Definition at line 2371 of file kapplication.cpp. References QString::isEmpty(). |
|
Starts a service based on the desktop path of the service. E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop"
Definition at line 2383 of file kapplication.cpp. |
|
Starts a service based on the desktop name of the service. E.g. "konqueror"
Definition at line 2392 of file kapplication.cpp. References QString::isEmpty(). Referenced by invokeBrowser(), invokeHelp(), invokeHTMLHelp(), and KNotifyClient::startDaemon(). |
|
Starts a service based on the desktop name of the service. E.g. "konqueror"
Definition at line 2404 of file kapplication.cpp. |
|
Starts a program via kdeinit. There will be no application startup notification, so you should use it only for starting internal processes. program name and arguments are converted to according to the local encoding and passed as is to kdeinit.
Definition at line 2420 of file kapplication.cpp. References KStdAction::name(). Referenced by invokeMailer(). |
|
Starts a program via kdeinit and wait for it to finish. Like kdeinitExec(), but it waits till the program is finished. As such it behaves similar to the system(...) function.
Definition at line 2435 of file kapplication.cpp. References KStdAction::name(). Referenced by KConfig::checkUpdate(). |
|
Returns a text for the window caption. This may be set by "-caption", otherwise it will be equivalent to the name of the executable.
Definition at line 1785 of file kapplication.cpp. References KInstance::aboutData(), KGlobal::instance(), QString::isNull(), KStdAction::name(), and KAboutData::programName(). Referenced by makeStdCaption(), and setTopWidget(). |
|
Definition at line 772 of file kapplication.h. |
|
Builds a caption that contains the application name along with the userCaption using a standard layout.
To make a compliant caption for your window, simply do:
Definition at line 1804 of file kapplication.cpp. References caption(), QString::endsWith(), QString::fromUtf8(), QString::isEmpty(), and QString::isNull(). |
|
Get a file name in order to make a temporary copy of your document.
Definition at line 2442 of file kapplication.cpp. References QDir::absPath(), KGlobal::dirs(), endl(), QDir::exists(), QDir::homeDirPath(), QDir::mkdir(), QString::replace(), and QDir::setPath(). |
|
Check whether an auto-save file exists for the document you want to open.
Definition at line 2470 of file kapplication.cpp. References QDir::absPath(), KGlobal::dirs(), endl(), QDir::exists(), QDir::homeDirPath(), QDir::mkdir(), QString::replace(), and QDir::setPath(). |
|
Enables style plugins. This is useful only to applications that normally do not display a GUI and create the KApplication with allowStyles set to false. Definition at line 1744 of file kapplication.cpp. |
|
Disables style plugins. Current style plugins do not get unloaded. This is only useful when used in combination with enableStyles(). Definition at line 1753 of file kapplication.cpp. |
|
Installs widget filter as global X11 event filter. The widget filter receives XEvents in its standard QWidget::x11Event() function. Warning: Only do this when absolutely necessary. An installed X11 filter can slow things down. Definition at line 376 of file kapplication.cpp. |
|
Removes global X11 event filter previously installed by installX11EventFilter().
Definition at line 391 of file kapplication.cpp. |
|
Generates a uniform random number.
Definition at line 2615 of file kapplication.cpp. References KStdAction::close(), and KStdAction::open(). Referenced by randomString(), and KRandomSequence::setSeed(). |
|
Generates a random string. It operates in the range [A-Za-z0-9]
Definition at line 2635 of file kapplication.cpp. References random(), and QString::setLength(). |
|
Adds a message type to the KIPC event mask. You can only add "system messages" to the event mask. These are the messages with id < 32. Messages with id >= 32 are user messages.
Definition at line 1724 of file kapplication.cpp. |
|
Removes a message type from the KIPC event mask. This message will not be handled anymore.
Definition at line 1734 of file kapplication.cpp. |
|
Returns the app startup notification identifier for this running application.
Definition at line 2591 of file kapplication.cpp. Referenced by setTopWidget(). |
|
Sets a new value for the application startup notification window property for newly created toplevel windows.
Definition at line 2596 of file kapplication.cpp. References QCString::isEmpty(). |
|
Updates the last user action timestamp to the given time, or to the current time, if 0 is given. Do not use unless you're really sure what you're doing. Consult focus stealing prevention section in kdebase/kwin/README.
Definition at line 1691 of file kapplication.cpp. |
|
Returns the argument to --geometry if any, so the geometry can be set wherever necessary.
Definition at line 1445 of file kapplication.cpp. |
|
Install a Qt SQL property map with entries for all KDE widgets Call this in any application using KDE widgets in QSqlForm or QDataView. If you are adding a widget that was missing please make sure to also add it to KConfigDialogManager's retrieveSettings() function. Thanks. Definition at line 1994 of file kapplication.cpp. References QSqlPropertyMap::insert(), and QSqlPropertyMap::installDefaultMap(). |
|
Returns whether a certain action is authorized.
Definition at line 2653 of file kapplication.cpp. References KGlobal::config(), and KConfigBase::readBoolEntry(). Referenced by authorizeKAction(). |
|
Returns whether a certain KAction is authorized.
Definition at line 2663 of file kapplication.cpp. References KStdAction::action(), authorize(), and KGlobal::staticQString(). |
|
Returns whether a certain URL related action is authorized.
Definition at line 2783 of file kapplication.cpp. References KStdAction::action(), QDir::cleanDirPath(), KURL::isEmpty(), KURL::path(), KURL::protocol(), KProtocolInfo::protocolClass(), and KURL::setPath(). Referenced by allowURLAction(). |
|
Allow a certain URL action. This can be useful if your application needs to ensure access to an application specific directory that may otherwise be subject to KIOSK restrictions.
Definition at line 2773 of file kapplication.cpp. References KStdAction::action(), authorizeURLAction(), KURL::host(), KURL::path(), and KURL::protocol(). |
|
Returns whether access to a certain control module is authorized.
Definition at line 2673 of file kapplication.cpp. References KGlobal::config(), QString::isEmpty(), and KConfigBase::readBoolEntry(). |
|
Returns whether access to a certain control modules is authorized.
Definition at line 2682 of file kapplication.cpp. References KGlobal::config(), and KConfigBase::readBoolEntry(). |
|
Returns the currently pressed keyboard modifiers (e.g. shift, control, etc.) Usually you simply want to test for those in key events, in which case QKeyEvent::state() does the job (or QKeyEvent::key() to notice when a modifier is pressed alone). But it can be useful to query for the status of the modifiers at another moment (e.g. some KDE apps do that upon a drop event).
Definition at line 2814 of file kapplication.cpp. |
|
Returns the currently pressed mouse buttons. Usually you simply want to test for those in mouse events, in which case QMouseEvent::button() does the job (or QMouseEvent::state()). But it can be useful to query for the status of the mouse buttons at another moment. To query for the mouse pointer position, use QCursor::pos().
Definition at line 2825 of file kapplication.cpp. |
|
Tells KApplication about one more operation that should be finished before the application exits. The standard behavior is to exit on the "last window closed" event, but some events should outlive the last window closed (e.g. a file copy for a file manager, or 'compacting folders on exit' for a mail client). Definition at line 929 of file kapplication.cpp. |
|
Tells KApplication that one operation such as those described in ref() just finished. The application exits if the counter is back to 0. Definition at line 935 of file kapplication.cpp. References QApplication::quit(). |
|
This method is used internally to determine which edit slots are implemented by the widget that has the focus, and to invoke those slots if available.
void MyApplication::deselect() { invokeEditSlot( SLOT( deselect() ) ); } Now in your application calls to MyApplication::deselect() will call this slot on the focused widget if it provides this slot. You can combine this with KAction with:
KStdAction::deselect( static_cast<MyApplication *>( kapp ), SLOT( cut() ), actionCollection() );
Definition at line 1709 of file kapplication.cpp. References QApplication::focusWidget(), and QObject::metaObject(). Referenced by clear(), copy(), cut(), paste(), and selectAll(). |
|
Used to obtain the QPalette that will be used to set the application palette. This is only useful for configuration modules such as krdb and should not be used in normal circumstances.
Definition at line 1823 of file kapplication.cpp. References KGlobal::config(), and KGlobalSettings::contrast(). |
|
Installs a handler for the SIGPIPE signal. It is thrown when you write to a pipe or socket that has been closed. The handler is installed automatically in the constructor, but you may need it if your application or component does not have a KApplication instance. Definition at line 2836 of file kapplication.cpp. Referenced by KApplication(). |
|
Emitted when KApplication has changed its palette due to a KControl request. Normally, widgets will update their palette automatically, but you should connect to this to program special behavior. |
|
Emitted when KApplication has changed its GUI style in response to a KControl request. Normally, widgets will update their styles automatically (as they would respond to an explicit setGUIStyle() call), but you should connect to this to program special behavior. |
|
Emitted when KApplication has changed its font in response to a KControl request. Normally widgets will update their fonts automatically, but you should connect to this to monitor global font changes, especially if you are using explicit fonts. Note: If you derive from a QWidget-based class, a faster method is to reimplement QWidget::fontChange(). This is the preferred way to get informed about font updates. |
|
Emitted when KApplication has changed either its GUI style, its font or its palette in response to a kdisplay request. Normally, widgets will update their styles automatically, but you should connect to this to program special behavior. |
|
Emitted when the settings for toolbars have been changed. KToolBar will know what to do. |
|
Emitted when the desktop background has been changed by
|
|
Emitted when the global settings have been changed - see KGlobalSettings KApplication takes care of calling reparseConfiguration on KGlobal::config() so that applications/classes using this only have to re-read the configuration.
|
|
Emitted when the global icon settings have been changed.
|
|
Emitted when a KIPC user message has been received.
|
|
Session management asks you to save the state of your application. This signal is provided for compatibility only. For new applications, simply use KMainWindow. By reimplementing KMainWindow::queryClose(), KMainWindow::saveProperties() and KMainWindow::readProperties() you can simply handle session management for applications with multiple toplevel windows. For purposes without KMainWindow, create an instance of KSessionManaged and reimplement the functions KSessionManaged::commitData() and/or KSessionManaged::saveState() If you still want to use this signal, here is what you should do: Connect to this signal in order to save your data. Do NOT manipulate the UI in that slot, it is blocked by the session manager. Use the sessionConfig() KConfig object to store all your instance specific data. Do not do any closing at this point! The user may still select Cancel wanting to continue working with your application. Cleanups could be done after shutDown() (see the following). |
|
Your application is killed.
Either by your program itself, The signal is particularly useful if your application has to do some last-second cleanups. Note that no user interaction is possible at this state. |
Member Data Documentation
|
Current application object.
Definition at line 137 of file kapplication.cpp. Referenced by kApplication(). |
The documentation for this class was generated from the following files: