diff options
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.h')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 0a87689ff3..5333ea22f4 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -220,12 +220,20 @@ public: \ { return QCoreApplication::translate(#context, sourceText, disambiguation, n); } \ private: +typedef void (*QtStartUpFunction)(); typedef void (*QtCleanUpFunction)(); +Q_CORE_EXPORT void qAddPreRoutine(QtStartUpFunction); Q_CORE_EXPORT void qAddPostRoutine(QtCleanUpFunction); Q_CORE_EXPORT void qRemovePostRoutine(QtCleanUpFunction); Q_CORE_EXPORT QString qAppName(); // get application name +#define Q_COREAPP_STARTUP_FUNCTION(AFUNC) \ + static void AFUNC ## _ctor_function() { \ + qAddPreRoutine(AFUNC); \ + } \ + Q_CONSTRUCTOR_FUNCTION(AFUNC ## _ctor_function) + #if defined(Q_OS_WIN) && !defined(QT_NO_DEBUG_STREAM) Q_CORE_EXPORT QString decodeMSG(const MSG &); Q_CORE_EXPORT QDebug operator<<(QDebug, const MSG &); |