diff --git a/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml b/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml index 0aab67e70fb307749686f53e94f2102fb661ba0e..5899c988d6c9ca64fdfb761fcfad10b9b06c9f5e 100644 --- a/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml +++ b/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml @@ -64,8 +64,8 @@ SetupPage { ExclusiveGroup { id: returnAltRadioGroup } Component.onCompleted: { - // Advanced tuning is hacked out due to Qt crash with Qml Charts and a QGuiApplication - //showAdvanced = !ScreenTools.isMobile + // We use QtCharts only on Desktop platforms + showAdvanced = !ScreenTools.isMobile // Qml Sliders have a strange behavior in which they first set Slider::value to some internal // setting and then set Slider::value to the bound properties value. If you have an onValueChanged diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml index 08960962f844c97d6e66390dbf5770f48743d7bd..3041a311cb3687e955df8bf5bf5731d2aef8db1c 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml @@ -29,8 +29,8 @@ SetupPage { width: availableWidth Component.onCompleted: { - // Advanced tuning is hacked out due to Qt crash with Qml Charts and a QGuiApplication - //showAdvanced = !ScreenTools.isMobile + // We use QtCharts only on Desktop platforms + showAdvanced = !ScreenTools.isMobile } FactPanelController { diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml index 7d91990c0ae5d281c326aa220c2ac70b71da2ec5..92ee1bee14d5d1b2f9515b30d2ffc183bb1d8258 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml @@ -29,8 +29,8 @@ SetupPage { width: availableWidth Component.onCompleted: { - // Advanced tuning is hacked out due to Qt crash with Qml Charts and a QGuiApplication - //showAdvanced = !ScreenTools.isMobile + // We use QtCharts only on Desktop platforms + showAdvanced = !ScreenTools.isMobile } FactPanelController { diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index 077ef10b7444dc98d9e53f82805bbb70837bc41c..7bb7c470e994c57b6fbd3ebebeeafb318fde8f9f 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; @@ -555,9 +559,6 @@ bool QGCApplication::_initForNormalAppBoot() QSettings settings; - // Exit main application when last window is closed - connect(this, &QGCApplication::lastWindowClosed, this, QGCApplication::quit); - _qmlAppEngine = toolbox()->corePlugin()->createRootWindow(this); // Safe to show popup error messages now that main window is created diff --git a/src/QGCApplication.h b/src/QGCApplication.h index 364da2d10866ba52ff126b0b678e7fae543af5cd..9bd19f75bcee00789f325a40b253ed8cbbbbec76 100644 --- a/src/QGCApplication.h +++ b/src/QGCApplication.h @@ -35,7 +35,25 @@ class QGCSingleton; class QGCToolbox; class QGCFileDownload; -class QGCApplication : public QGuiApplication +/** + * @brief The main application and management class. + * + * This class is started by the main method and provides + * the central management unit of the groundstation application. + * + * Needs QApplication base to support QtCharts module. This way + * we avoid application crashing on 5.12 when using the module. + * We don't have QtWidgets on mobile, avoid using it. + * + * Note: `lastWindowClosed` will be sent by MessageBox popups and other + * dialogs, that are spawned in QML, when they are closed +**/ +class QGCApplication : + #if defined(__mobile__) + public QGuiApplication + #else + public QApplication + #endif { Q_OBJECT diff --git a/src/QmlControls/QmlObjectListModel.cc b/src/QmlControls/QmlObjectListModel.cc index 1395fa862143f0162fb58da0f5dd87f9728ea64d..2139093c0d0acfe1a88ffff19b64d210ff7576a5 100644 --- a/src/QmlControls/QmlObjectListModel.cc +++ b/src/QmlControls/QmlObjectListModel.cc @@ -285,7 +285,7 @@ void QmlObjectListModel::clearAndDeleteContents() endResetModel(); } -void QmlObjectListModel::beginReset(void) +void QmlObjectListModel::beginReset() { if (_externalBeginResetModel) { qWarning() << "QmlObjectListModel::beginReset already set"; @@ -294,7 +294,7 @@ void QmlObjectListModel::beginReset(void) beginResetModel(); } -void QmlObjectListModel::endReset(void) +void QmlObjectListModel::endReset() { if (!_externalBeginResetModel) { qWarning() << "QmlObjectListModel::endReset begin not set";