diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2012-12-06 20:02:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-14 19:49:38 +0100 |
commit | 59fc1102f304e3d103eaa5d9cd69acb7402efc28 (patch) | |
tree | f46776946ae406d216d6f06c1889539c47da94da /src/corelib/kernel/qcoreapplication.h | |
parent | e6aba2f7cd02e5b268eb764765dc935bd8ba05a3 (diff) |
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 <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.h')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 9f9a1c14fd..ae17aeec0e 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -42,13 +42,21 @@ #ifndef QCOREAPPLICATION_H #define QCOREAPPLICATION_H +#include <QtCore/qglobal.h> +#include <QtCore/qstring.h> +#ifndef QT_NO_QOBJECT #include <QtCore/qobject.h> #include <QtCore/qcoreevent.h> #include <QtCore/qeventloop.h> +#else +#include <QtCore/qscopedpointer.h> +#endif +#ifndef QT_NO_QOBJECT #if defined(Q_OS_WIN) && !defined(tagMSG) typedef struct tagMSG MSG; #endif +#endif QT_BEGIN_NAMESPACE @@ -63,14 +71,19 @@ class QAbstractNativeEventFilter; #define qApp QCoreApplication::instance() -class Q_CORE_EXPORT QCoreApplication : public QObject +class Q_CORE_EXPORT QCoreApplication +#ifndef QT_NO_QOBJECT + : public QObject +#endif { +#ifndef QT_NO_QOBJECT Q_OBJECT Q_PROPERTY(QString applicationName READ applicationName WRITE setApplicationName NOTIFY applicationNameChanged) Q_PROPERTY(QString applicationVersion READ applicationVersion WRITE setApplicationVersion NOTIFY applicationVersionChanged) Q_PROPERTY(QString organizationName READ organizationName WRITE setOrganizationName NOTIFY organizationNameChanged) Q_PROPERTY(QString organizationDomain READ organizationDomain WRITE setOrganizationDomain NOTIFY organizationDomainChanged) Q_PROPERTY(bool quitLockEnabled READ isQuitLockEnabled WRITE setQuitLockEnabled) +#endif Q_DECLARE_PRIVATE(QCoreApplication) public: @@ -101,6 +114,7 @@ public: static QCoreApplication *instance() { return self; } +#ifndef QT_NO_QOBJECT static int exec(); static void processEvents(QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents); static void processEvents(QEventLoop::ProcessEventsFlags flags, int maxtime); @@ -118,6 +132,7 @@ public: static bool startingUp(); static bool closingDown(); +#endif static QString applicationDirPath(); static QString applicationFilePath(); @@ -146,6 +161,7 @@ public: { return translate(context, key, disambiguation, n); } #endif +#ifndef QT_NO_QOBJECT static void flush(); void installNativeEventFilter(QAbstractNativeEventFilter *filterObj); @@ -173,13 +189,20 @@ protected: bool event(QEvent *); virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *); +#endif // QT_NO_QOBJECT protected: QCoreApplication(QCoreApplicationPrivate &p); +#ifdef QT_NO_QOBJECT + QScopedPointer<QCoreApplicationPrivate> d_ptr; +#endif + private: +#ifndef QT_NO_QOBJECT static bool sendSpontaneousEvent(QObject *receiver, QEvent *event); bool notifyInternal(QObject *receiver, QEvent *event); +#endif void init(); @@ -187,7 +210,6 @@ private: Q_DISABLE_COPY(QCoreApplication) - friend class QEventDispatcherUNIXPrivate; friend class QApplication; friend class QApplicationPrivate; friend class QGuiApplication; @@ -196,17 +218,22 @@ private: friend class QWidget; friend class QWidgetWindow; friend class QWidgetPrivate; +#ifndef QT_NO_QOBJECT + friend class QEventDispatcherUNIXPrivate; friend class QCocoaEventDispatcherPrivate; friend bool qt_sendSpontaneousEvent(QObject*, QEvent*); +#endif friend Q_CORE_EXPORT QString qAppName(); friend class QClassFactory; }; +#ifndef QT_NO_QOBJECT inline bool QCoreApplication::sendEvent(QObject *receiver, QEvent *event) { if (event) event->spont = false; return self ? self->notifyInternal(receiver, event) : false; } inline bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *event) { if (event) event->spont = true; return self ? self->notifyInternal(receiver, event) : false; } +#endif #ifdef QT_NO_DEPRECATED # define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) @@ -237,10 +264,12 @@ Q_CORE_EXPORT QString qAppName(); // get application name } \ Q_CONSTRUCTOR_FUNCTION(AFUNC ## _ctor_function) +#ifndef QT_NO_QOBJECT #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 &); #endif +#endif QT_END_NAMESPACE |