From f2a1bd16092f2f42208893d981589102d7bcfe05 Mon Sep 17 00:00:00 2001 From: Stefan Dunca Date: Tue, 5 Nov 2019 12:09:22 +0100 Subject: [PATCH] Fix enabling Andvanced Tuning crash --- src/QGCApplication.cc | 4 ++++ src/QGCApplication.h | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index f09d1dcf2..40c3a62d9 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -158,7 +158,11 @@ static QObject* shapeFileHelperSingletonFactory(QQmlEngine*, QJSEngine*) } QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) + #if defined(__mobile__) : QGuiApplication (argc, argv) + #else + : QApplication (argc, argv) + #endif , _runningUnitTests (unitTesting) { _app = this; diff --git a/src/QGCApplication.h b/src/QGCApplication.h index c47b477ad..19b293883 100644 --- a/src/QGCApplication.h +++ b/src/QGCApplication.h @@ -51,8 +51,15 @@ class QGCFileDownload; * This class is started by the main method and provides * the central management unit of the groundstation application. * - **/ -class QGCApplication : public QGuiApplication + * Needs QApplication base to support QtCharts drawing module and + * avoid application crashing on 5.12. Enforce no widget on mobile +**/ +class QGCApplication : + #if defined(__mobile__) + public QGuiApplication + #else + public QApplication + #endif { Q_OBJECT -- 2.22.0