Commit 9a307a67 authored by DonLakeFlyer's avatar DonLakeFlyer

Hack workaround to 5.9 android FileDialog Qt bug

https://bugreports.qt.io/browse/QTBUG-61424
parent 54c92f75
<RCC>
<qresource prefix="/qml">
<file alias="QGroundControl/Controls/HackFileDialog.qml">src/QmlControls/HackAndroidFileDialog.qml</file>
</qresource>
</RCC>
<RCC>
<qresource prefix="/qml">
<file alias="QGroundControl/Controls/HackFileDialog.qml">src/QmlControls/HackFileDialog.qml</file>
</qresource>
</RCC>
...@@ -13,8 +13,8 @@ exists($${OUT_PWD}/qgroundcontrol.pro) { ...@@ -13,8 +13,8 @@ exists($${OUT_PWD}/qgroundcontrol.pro) {
message(Qt version $$[QT_VERSION]) message(Qt version $$[QT_VERSION])
!equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 4) { !equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 6) {
error("Unsupported Qt version, 5.5+ is required") error("Unsupported Qt version, 5.7+ is required")
} }
include(QGCCommon.pri) include(QGCCommon.pri)
...@@ -288,6 +288,15 @@ CustomBuild { ...@@ -288,6 +288,15 @@ CustomBuild {
$$PWD/qgcresources.qrc $$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 # Main QGroundControl portion of project file
# #
......
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
}
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 {
}
...@@ -66,7 +66,10 @@ Item { ...@@ -66,7 +66,10 @@ Item {
QGCFileDialogController { id: controller } QGCFileDialogController { id: controller }
QGCPalette { id: qgcPal; colorGroupEnabled: true } 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 id: fullFileDialog
folder: "file://" + _root.folder folder: "file://" + _root.folder
nameFilters: _root.nameFilters ? _root.nameFilters : [] nameFilters: _root.nameFilters ? _root.nameFilters : []
......
...@@ -13,6 +13,7 @@ FlightModeDropdown 1.0 FlightModeDropdown.qml ...@@ -13,6 +13,7 @@ FlightModeDropdown 1.0 FlightModeDropdown.qml
FlightModeMenu 1.0 FlightModeMenu.qml FlightModeMenu 1.0 FlightModeMenu.qml
GeoFenceEditor 1.0 GeoFenceEditor.qml GeoFenceEditor 1.0 GeoFenceEditor.qml
GeoFenceMapVisuals 1.0 GeoFenceMapVisuals.qml GeoFenceMapVisuals 1.0 GeoFenceMapVisuals.qml
HackFileDialog 1.0 HackFileDialog.qml
IndicatorButton 1.0 IndicatorButton.qml IndicatorButton 1.0 IndicatorButton.qml
JoystickThumbPad 1.0 JoystickThumbPad.qml JoystickThumbPad 1.0 JoystickThumbPad.qml
MainToolBar 1.0 MainToolBar.qml MainToolBar 1.0 MainToolBar.qml
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment