From 59fc1102f304e3d103eaa5d9cd69acb7402efc28 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 Dec 2012 20:02:08 +0100 Subject: add QCoreApplication to bootstrap lib this required making it compile with QT_NO_QOBJECT. of course this disables anything related to threading and event processing. needed for bootstrapping qmldevtools (qmlmin, lupdate) Change-Id: I6f8bd3996ac7b6eee49a5b8a55143d358abe35ee Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qcoreapplication_p.h | 46 +++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 14 deletions(-) (limited to 'src/corelib/kernel/qcoreapplication_p.h') diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index 36ba0663b7..563a3b2093 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -56,7 +56,9 @@ #include "QtCore/qcoreapplication.h" #include "QtCore/qtranslator.h" #include "QtCore/qsettings.h" +#ifndef QT_NO_QOBJECT #include "private/qobject_p.h" +#endif QT_BEGIN_NAMESPACE @@ -64,7 +66,10 @@ typedef QList QTranslatorList; class QAbstractEventDispatcher; -class Q_CORE_EXPORT QCoreApplicationPrivate : public QObjectPrivate +class Q_CORE_EXPORT QCoreApplicationPrivate +#ifndef QT_NO_QOBJECT + : public QObjectPrivate +#endif { Q_DECLARE_PUBLIC(QCoreApplication) @@ -77,23 +82,27 @@ public: QCoreApplicationPrivate(int &aargc, char **aargv, uint flags); ~QCoreApplicationPrivate(); + QString appName() const; + +#ifdef Q_OS_MAC + static QString macMenuBarName(); +#endif + + static void initLocale(); + + static bool checkInstance(const char *method); + +#ifndef QT_NO_QOBJECT bool sendThroughApplicationEventFilters(QObject *, QEvent *); bool sendThroughObjectEventFilters(QObject *, QEvent *); bool notify_helper(QObject *, QEvent *); - QString appName() const; virtual void createEventDispatcher(); static void removePostedEvent(QEvent *); #ifdef Q_OS_WIN static void removePostedTimerEvent(QObject *object, int timerId); #endif -#ifdef Q_OS_MAC - static QString macMenuBarName(); -#endif - - static void initLocale(); - QAtomicInt quitLockRef; void ref(); void deref(); @@ -104,12 +113,14 @@ public: static QThread *theMainThread; static QThread *mainThread(); - static bool checkInstance(const char *method); static void sendPostedEvents(QObject *receiver, int event_type, QThreadData *data); #if !defined (QT_NO_DEBUG) || defined (QT_MAC_FRAMEWORK_BUILD) void checkReceiverThread(QObject *receiver); #endif + void cleanupThreadData(); +#endif // QT_NO_QOBJECT + int &argc; char **argv; #ifdef Q_OS_WIN @@ -117,24 +128,27 @@ public: char **origArgv; // store unmodified arguments for QCoreApplication::arguments() #endif void appendApplicationPathToLibraryPaths(void); - void cleanupThreadData(); #ifndef QT_NO_TRANSLATION QTranslatorList translators; + + static bool isTranslatorInstalled(QTranslator *translator); #endif + uint application_type; - bool in_exec; - bool aboutToQuitEmitted; - bool threadData_clean; QString cachedApplicationDirPath; QString cachedApplicationFilePath; - static bool isTranslatorInstalled(QTranslator *translator); +#ifndef QT_NO_QOBJECT + bool in_exec; + bool aboutToQuitEmitted; + bool threadData_clean; static QAbstractEventDispatcher *eventDispatcher; static bool is_app_running; static bool is_app_closing; +#endif static uint attribs; static inline bool testAttribute(uint flag) { return attribs & (1 << flag); } @@ -143,6 +157,10 @@ public: void processCommandLineArguments(); QString qmljs_debug_arguments; // a string containing arguments for js/qml debugging. inline QString qmljsDebugArgumentsString() { return qmljs_debug_arguments; } + +#ifdef QT_NO_QOBJECT + QCoreApplication *q_ptr; +#endif }; QT_END_NAMESPACE -- cgit v1.2.3