KDELibs4Support
kglobal.h
81 * MSVC seems to give anonymous structs the same name which fails at link time. So instead we name
82 * the struct and hope that by adding the line number to the name it's unique enough to never clash.
107 * If you have code that might be called after the global object has been destroyed you can check
111 * global statics (e.g. KConfig::sync) your destructor has to be called before those global statics
112 * are destroyed. A Qt post routine does that.) you can also install a post routine (qAddPostRoutine) to clean up the object
113 * using the destroy() method. If you registered a post routine and the object is destroyed because
159 * A common case for the need of deletion on lib unload/app shutdown are Singleton classes. Here's
199 * Instead of the above you can use also the following pattern (ignore the name of the namespace):
362 KDELIBS4SUPPORT_DEPRECATED_EXPORT const KComponentData &mainComponent(); //krazy:exclude=constref (don't mess up ref-counting)
367 * @deprecated since 5.0, use KComponentData::hasMainComponent() if you really need a KComponentData
400 * @deprecated since 5.0, port to if (qApp) because KLocale::global() can be called, as soon as a qApp exists.
435 KDELIBS4SUPPORT_DEPRECATED_EXPORT const QString &staticQString(const char *str); //krazy:exclude=constref (doesn't make sense otherwise)
455 KDELIBS4SUPPORT_DEPRECATED_EXPORT const QString &staticQString(const QString &str); //krazy:exclude=constref (doesn't make sense otherwise)
466 * - job start 1; job end 0 [don't exit yet]; open window -> setAllowQuit(true) 1 ; close window 0 => EXIT
472 * - open window -> setAllowQuit(true) 1; add systray icon 2; remove systray icon 1; close window 0 => EXIT
473 * - unit test which opens and closes many windows: should call ref() to avoid subevent-loops quitting too early.
500 * _what_ is making your application still alive to the user (like a systray icon or a D-Bus object)
537 * If you really need this, use QGuiApplication::applicationDisplayName(), and if that's empty, QCoreApplication::applicationName().
542 KDELIBS4SUPPORT_DEPRECATED_EXPORT QObject *findDirectChild_helper(const QObject *parent, const QMetaObject &mo);
545 * Returns the child of the given object that can be cast into type T, or 0 if there is no such object.
553 return static_cast<T>(findDirectChild_helper(object, (static_cast<T>(nullptr))->staticMetaObject));
T findDirectChild(const QObject *object)
Returns the child of the given object that can be cast into type T, or 0 if there is no such object.
Definition: kglobal.h:551
void ref()
Tells KGlobal about one more operations that should be finished before the application exits.
Definition: kglobal.cpp:207
KComponentData activeComponent()
The component currently active (useful in a multi-component application, such as a KParts application...
Definition: kglobal.cpp:138
void deref()
Tells KGlobal that one operation such as those described in ref() just finished.
Definition: kglobal.cpp:213
void setAllowQuit(bool allowQuit)
If refcounting reaches 0 (or less), and allowQuit is true, the instance of the application will autom...
Definition: kglobal.cpp:222
void setActiveComponent(const KComponentData &d)
Set the active component for use by KAboutDialog and KBugReport.
Definition: kglobal.cpp:143
QObject * findDirectChild_helper(const QObject *parent, const QMetaObject &mo)
Definition: kglobal.cpp:229
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:55:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:55:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.