diff --git a/HackAndroidFileDialog.qrc b/HackAndroidFileDialog.qrc new file mode 100644 index 0000000000000000000000000000000000000000..509c47125d627c3aa8c57724f9d36a919677bb75 --- /dev/null +++ b/HackAndroidFileDialog.qrc @@ -0,0 +1,5 @@ + + + src/QmlControls/HackAndroidFileDialog.qml + + diff --git a/HackFileDialog.qrc b/HackFileDialog.qrc new file mode 100644 index 0000000000000000000000000000000000000000..a7436f2702a0771ab125b90438e11cae8c0883d2 --- /dev/null +++ b/HackFileDialog.qrc @@ -0,0 +1,5 @@ + + + src/QmlControls/HackFileDialog.qml + + diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 549455492f6720e7057dbc177db23fc3921d1df5..f20c2f2b173b926eb11e82a300c7f1d4605830b8 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -13,8 +13,8 @@ exists($${OUT_PWD}/qgroundcontrol.pro) { message(Qt version $$[QT_VERSION]) -!equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 4) { - error("Unsupported Qt version, 5.5+ is required") +!equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 6) { + error("Unsupported Qt version, 5.7+ is required") } include(QGCCommon.pri) @@ -288,6 +288,15 @@ CustomBuild { $$PWD/qgcresources.qrc } +# On Qt 5.9 android versions there is the following bug: https://bugreports.qt.io/browse/QTBUG-61424 +# This prevents FileDialog from being used. So we have a temp hack workaround for it which just no-ops +# the FileDialog fallback mechanism on android 5.9 builds. +equals(QT_MAJOR_VERSION, 5):equals(QT_MINOR_VERSION, 9):AndroidBuild { + RESOURCES += $$PWD/HackAndroidFileDialog.qrc +} else { + RESOURCES += $$PWD/HackFileDialog.qrc +} + # # Main QGroundControl portion of project file # diff --git a/src/QmlControls/HackAndroidFileDialog.qml b/src/QmlControls/HackAndroidFileDialog.qml new file mode 100644 index 0000000000000000000000000000000000000000..f6c3ec909460f28496264a40b3dba3872387205d --- /dev/null +++ b/src/QmlControls/HackAndroidFileDialog.qml @@ -0,0 +1,18 @@ +import QtQuick 2.3 +import QtQuick.Dialogs 1.2 + +// On Qt 5.9 android versions there is the following bug: https://bugreports.qt.io/browse/QTBUG-61424 +// This prevents FileDialog from being used. So we have a temp hack workaround for it which just no-ops +// the FileDialog fallback mechanism on android 5.9 builds. + +Item { + property var folder + property var nameFilters + property var title + property var selectExisting + property var selectMultiple + property var selectFolder + + signal accepted + signal rejected +} diff --git a/src/QmlControls/HackFileDialog.qml b/src/QmlControls/HackFileDialog.qml new file mode 100644 index 0000000000000000000000000000000000000000..24e0c5dd6245ac80ef7b30d2829572d7190ae922 --- /dev/null +++ b/src/QmlControls/HackFileDialog.qml @@ -0,0 +1,9 @@ +import QtQuick 2.3 +import QtQuick.Dialogs 1.2 + +// On Qt 5.9 android versions there is the following bug: https://bugreports.qt.io/browse/QTBUG-61424 +// This prevents FileDialog from being used. So we have a temp hack workaround for it which just no-ops +// the FileDialog fallback mechanism on android 5.9 builds. + +FileDialog { +} diff --git a/src/QmlControls/QGCFileDialog.qml b/src/QmlControls/QGCFileDialog.qml index c10dbcf13d53ab6c894f6ecb2c3a2bee8bf87b47..3ab7fce5353e64fb122b5e5b288b76af2bdb129d 100644 --- a/src/QmlControls/QGCFileDialog.qml +++ b/src/QmlControls/QGCFileDialog.qml @@ -66,7 +66,10 @@ Item { QGCFileDialogController { id: controller } QGCPalette { id: qgcPal; colorGroupEnabled: true } - FileDialog { + // On Qt 5.9 android versions there is the following bug: https://bugreports.qt.io/browse/QTBUG-61424 + // This prevents FileDialog from being used. So we have a temp hack workaround for it which just no-ops + // the FileDialog fallback mechanism on android 5.9 builds. + HackFileDialog { id: fullFileDialog folder: "file://" + _root.folder nameFilters: _root.nameFilters ? _root.nameFilters : [] diff --git a/src/QmlControls/QGroundControl.Controls.qmldir b/src/QmlControls/QGroundControl.Controls.qmldir index 8f3050ffbe523e5cdcd228119c1ddc24eb166e50..64be6551d20ea30d1b50b80ddf39a67d11eeb37f 100644 --- a/src/QmlControls/QGroundControl.Controls.qmldir +++ b/src/QmlControls/QGroundControl.Controls.qmldir @@ -13,6 +13,7 @@ FlightModeDropdown 1.0 FlightModeDropdown.qml FlightModeMenu 1.0 FlightModeMenu.qml GeoFenceEditor 1.0 GeoFenceEditor.qml GeoFenceMapVisuals 1.0 GeoFenceMapVisuals.qml +HackFileDialog 1.0 HackFileDialog.qml IndicatorButton 1.0 IndicatorButton.qml JoystickThumbPad 1.0 JoystickThumbPad.qml MainToolBar 1.0 MainToolBar.qml