diff options
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.h')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 0a87689ff3..b235e327e0 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -50,8 +50,6 @@ typedef struct tagMSG MSG; #endif -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -220,12 +218,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 &); @@ -233,6 +239,4 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const MSG &); QT_END_NAMESPACE -QT_END_HEADER - #endif // QCOREAPPLICATION_H |