class KGlobal

# class KGlobal | Access to the KDE global objects. More...
Definition | `#include <kglobal.h>`
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Static Methods

- static KInstance * instance ()
- static KStandardDirs * dirs ()
- static KConfig * config ()
- static KIconLoader * iconLoader ()
- static KLocale * locale ()
- static KCharsets * charsets ()
- static const QString & staticQString (const char *str)
- static const QString & staticQString (const QString &str)
- static void registerStaticDeleter (KStaticDeleterBase *d)
- static void unregisterStaticDeleter (KStaticDeleterBase *d)
- static void deleteStaticDeleters ()
- static void setActiveInstance (KInstance *d)
- static KInstance * activeInstance ()

#### Public Members

- static KStringDict *_stringDict
- static KInstance *_instance
- static KLocale *_locale
- static KCharsets *_charsets
- static KStaticDeleterList *_staticDeleters
- static KInstance *_activeInstance

## Detailed Description

Access to the KDE global objects. KGlobal provides you with pointers of many central objects that exist only once in the process. It is also responsible for managing instances of KStaticDeleterBase.

See also: KStaticDeleterBase

KInstance * instance () | ### instance

[static]

Returns the global instance. There is always at least one instance of a component in one application (in most cases the application itself).

Returns: the global instance

KStandardDirs * dirs () | ### dirs

[static]

Returns the application standard dirs object.

Returns: the global standard dir object

KConfig * config () | ### config

[static]

Returns the general config object.

Returns: the global configuration object.

KIconLoader * iconLoader () | ### iconLoader

[static]

Returns an iconloader object.

Returns: the global iconloader object

KLocale * locale () | ### locale

[static]

Returns the global locale object.

Returns: the global locale object

KCharsets * charsets () | ### charsets

[static]

The global charset manager.

Returns: the global charset manager

const QString & staticQString (const char *str) | ### staticQString

[static]

Creates a static QString.

To be used inside functions(!) like:

     static const QString &myString = KGlobal::staticQString("myText");

!!! Do _NOT_ use: !!!

     static QString myString = KGlobal::staticQString("myText");

This creates a static object (instead of a static reference) and as you know static objects are EVIL.

Parameters:

str | the string to create

Returns: the static string

const QString & staticQString (const QString &str) | ### staticQString

[static]

Creates a static QString.

To be used inside functions(!) like:

     static const QString &myString = KGlobal::staticQString(i18n("My Text"));

!!! Do _NOT_ use: !!!

     static QString myString = KGlobal::staticQString(i18n("myText"));

This creates a static object (instead of a static reference) and as you know static objects are EVIL.

Parameters:

str | the string to create

Returns: the static string

void registerStaticDeleter (KStaticDeleterBase *d) | ### registerStaticDeleter

[static]

Registers a static deleter.

Parameters:

d | the static deleter to register

See also: KStaticDeleterBase, KStaticDeleter

void unregisterStaticDeleter (KStaticDeleterBase *d) | ### unregisterStaticDeleter

[static]

Unregisters a static deleter.

Parameters:

d | the static deleter to unregister

See also: KStaticDeleterBase, KStaticDeleter

void deleteStaticDeleters () | ### deleteStaticDeleters

[static]

Calls KStaticDeleterBase::destructObject() on all registered static deleters and unregisters them all.

See also: KStaticDeleterBase, KStaticDeleter

static KStringDict * _stringDict | ### _stringDict

static KInstance * _instance | ### _instance

static KLocale * _locale | ### _locale

static KCharsets * _charsets | ### _charsets

static KStaticDeleterList * _staticDeleters | ### _staticDeleters

void setActiveInstance (KInstance *d) | ### setActiveInstance

[static]

The instance currently active (useful in a multi-instance application, such as a KParts application). Don't use this - it's mainly for KAboutDialog and KBugReport.

KInstance * activeInstance () | ### activeInstance

[static]

static KInstance * _activeInstance | ### _activeInstance

- Version: $Id: kglobal.h,v 1.44 2002/09/19 19:41:42 tjansen Exp $
- Author: Sirtaj Singh Kang (taj@kde.org)
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:15 2003, using kdoc 2.0a54.