KDECore
KGlobal Namespace Reference
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
Enumerations | |
| enum | CopyCatalogs { DoCopyCatalogs, DontCopyCatalogs } |
Functions | |
| KStandardDirs * | dirs () |
| KSharedConfig::Ptr | config () |
| const KComponentData & | mainComponent () |
| bool | hasMainComponent () |
| KLocale * | locale () |
| bool | hasLocale () |
| KCharsets * | charsets () |
| KComponentData | activeComponent () |
| void | setActiveComponent (const KComponentData &d) |
| void | newComponentData (const KComponentData &c) |
| void | setLocale (KLocale *locale, CopyCatalogs copy) |
| const QString & | staticQString (const char *str) |
| const QString & | staticQString (const QString &str) |
| QString | caption () |
| void | ref () |
| void | deref () |
Enumeration Type Documentation
Function Documentation
| KComponentData KGlobal::activeComponent | ( | ) |
The component currently active (useful in a multi-component application, such as a KParts application).
Don't use this - it's mainly for KAboutDialog and KBugReport.
Definition at line 153 of file kglobal.cpp.
| QString KGlobal::caption | ( | ) |
Returns a text for the window caption.
This may be set by "-caption", otherwise it will be equivalent to the name of the executable.
- Returns:
- the text for the window caption
Definition at line 215 of file kglobal.cpp.
| KCharsets * KGlobal::charsets | ( | ) |
The global charset manager.
- Returns:
- the global charset manager
Definition at line 143 of file kglobal.cpp.
| KSharedConfigPtr KGlobal::config | ( | ) |
Returns the general config object.
- Returns:
- the global configuration object.
Definition at line 96 of file kglobal.cpp.
| void KGlobal::deref | ( | ) |
Tells KGlobal that one operation such as those described in ref() just finished.
This call makes the QApplication quit if the counter is back to 0.
Definition at line 247 of file kglobal.cpp.
| KStandardDirs * KGlobal::dirs | ( | ) |
Returns the application standard dirs object.
- Returns:
- the global standard dir object
Definition at line 89 of file kglobal.cpp.
| bool KGlobal::hasLocale | ( | ) |
Definition at line 134 of file kglobal.cpp.
| bool KGlobal::hasMainComponent | ( | ) |
Definition at line 110 of file kglobal.cpp.
| KLocale * KGlobal::locale | ( | ) |
Returns the global locale object.
- Returns:
- the global locale object
Definition at line 119 of file kglobal.cpp.
| const KComponentData & KGlobal::mainComponent | ( | ) |
Returns the global component data.
There is always at least one instance of a component in one application (in most cases the application itself).
- Returns:
- the global component data
Definition at line 103 of file kglobal.cpp.
| void KGlobal::newComponentData | ( | const KComponentData & | c | ) |
Definition at line 169 of file kglobal.cpp.
| void KGlobal::ref | ( | ) |
Tells KGlobal about one more operations 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).
Note that for this to happen you must call qApp->setQuitOnLastWindowClosed(false), in main() for instance.
Definition at line 241 of file kglobal.cpp.
| void KGlobal::setActiveComponent | ( | const KComponentData & | d | ) |
Set the active component for use by KAboutDialog and KBugReport.
To be used only by a multi-component (KParts) application.
- See also:
- activeComponent()
Definition at line 160 of file kglobal.cpp.
| void KGlobal::setLocale | ( | KLocale * | locale, | |
| CopyCatalogs | copy | |||
| ) |
Definition at line 179 of file kglobal.cpp.
Create a static QString.
Creates a static QString.
To be used inside functions(!) like: static const QString &myString = KGlobal::staticQString(i18n("My Text"));
To be used inside functions(!) like:
static const QString &myString = KGlobal::staticQString(i18n("My Text"));
- Attention:
- Do NOT use code such as: This creates a static object (instead of a static reference) and as you know static objects are EVIL.
static QString myString = KGlobal::staticQString(i18n("myText"));
- Parameters:
-
str the string to create
- Returns:
- the static string
Definition at line 205 of file kglobal.cpp.
| const QString & KGlobal::staticQString | ( | const char * | str | ) |
Create a static QString.
Creates a static QString.
To be used inside functions(!) like: static const QString &myString = KGlobal::staticQString("myText");
To be used inside functions(!) like:
static const QString &myString = KGlobal::staticQString("myText");
- Attention:
- Do NOT use code such as: This creates a static object (instead of a static reference) and as you know static objects are EVIL.
static QString myString = KGlobal::staticQString("myText");
- Parameters:
-
str the string to create
- Returns:
- the static string
Definition at line 194 of file kglobal.cpp.
KDE 4.0 API Reference