diff --git a/src/xbus/utils.h b/src/xbus/utils.h index 2a213dc97..7b38d4e2f 100644 --- a/src/xbus/utils.h +++ b/src/xbus/utils.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -82,13 +82,13 @@ public: * Qt framework, they can simply copy & paste this class into their project * and both X-Plane plugins will be able to share a single QApplication safely. */ -class QSharedApplication : public QApplication +class QSharedApplication : public QCoreApplication { Q_OBJECT - QWeakPointer m_weakptr; + QWeakPointer m_weakptr; - QSharedApplication(QSharedPointer &ptr, int &argc, char **argv) : QApplication(argc, argv) + QSharedApplication(QSharedPointer &ptr, int &argc, char **argv) : QCoreApplication(argc, argv) { ptr.reset(this); m_weakptr = ptr; @@ -102,9 +102,9 @@ public: * * The QApplication will not be destroyed while this shared pointer exists. */ - static QSharedPointer sharedInstance() + static QSharedPointer sharedInstance() { - QSharedPointer ptr; + QSharedPointer ptr; if (! instance()) { static int argc = 1; @@ -123,7 +123,7 @@ public: } if (! instance()->inherits("QSharedApplication")) { - qFatal("There is an unshared QApplication in another plugin"); + qFatal("There is an unshared QCoreApplication in another plugin"); } return static_cast(instance())->m_weakptr; } @@ -148,8 +148,8 @@ class QXPlaneEventLoop : public QObject static float callback(float, float, int, void *) { - QApplication::processEvents(); - QApplication::sendPostedEvents(); + QCoreApplication::processEvents(); + QCoreApplication::sendPostedEvents(); return -1; } @@ -160,9 +160,9 @@ public: */ static void exec() { - if (! QApplication::instance()->findChild()) + if (! QCoreApplication::instance()->findChild()) { - new QXPlaneEventLoop(QApplication::instance()); + new QXPlaneEventLoop(QCoreApplication::instance()); } } };