diff --git a/CodingStyle.qml b/CodingStyle.qml
index adff51787..79c70d499 100644
--- a/CodingStyle.qml
+++ b/CodingStyle.qml
@@ -8,13 +8,13 @@
****************************************************************************/
-import QtQuick 2.5
-import QtQuick.Controls 1.3
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
/// This is an example Qml file which is used to describe the QGroundControl coding style.
/// In general almost everything in here has some coding style meaning including order of
diff --git a/VideoReceiverApp/main.qml b/VideoReceiverApp/main.qml
index b23181180..8f67229e0 100644
--- a/VideoReceiverApp/main.qml
+++ b/VideoReceiverApp/main.qml
@@ -1,7 +1,7 @@
-import QtQuick 2.12
-import QtQuick.Window 2.12
-import QtQuick.Layouts 1.3
-import org.freedesktop.gstreamer.GLVideoItem 1.0
+import QtQuick
+import QtQuick.Window
+import QtQuick.Layouts
+import org.freedesktop.gstreamer.GLVideoItem
Window {
visible: true
diff --git a/custom-example/qgroundcontrol.qrc b/custom-example/qgroundcontrol.qrc
index 5a5617315..069fec8d1 100644
--- a/custom-example/qgroundcontrol.qrc
+++ b/custom-example/qgroundcontrol.qrc
@@ -173,7 +173,7 @@
../src/PlanView/RallyPointMapVisuals.qml
../src/QmlControls/RCChannelMonitor.qml
../src/QmlControls/RCToParamDialog.qml
- ../src/QmlControls/RoundButton.qml
+ ../src/QmlControls/QGCRoundButton.qml
../src/QmlControls/SectionHeader.qml
../src/AutoPilotPlugins/Common/SetupPage.qml
../src/ui/toolbar/SignalStrength.qml
diff --git a/custom-example/res/Custom/Camera/ZoomControl.qml b/custom-example/res/Custom/Camera/ZoomControl.qml
index 8948777d2..14050c179 100644
--- a/custom-example/res/Custom/Camera/ZoomControl.qml
+++ b/custom-example/res/Custom/Camera/ZoomControl.qml
@@ -1,7 +1,5 @@
-import QtQuick 2.0
-import QtQuick.Controls 2.4
-import QtGraphicalEffects 1.0
-
+import QtQuick
+import QtQuick.Controls
Item {
id: _root
diff --git a/custom-example/res/Custom/Widgets/CustomArtificialHorizon.qml b/custom-example/res/Custom/Widgets/CustomArtificialHorizon.qml
index cb024582b..f11b582e3 100644
--- a/custom-example/res/Custom/Widgets/CustomArtificialHorizon.qml
+++ b/custom-example/res/Custom/Widgets/CustomArtificialHorizon.qml
@@ -9,7 +9,7 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
+import QtQuick
Item {
id: root
diff --git a/custom-example/res/Custom/Widgets/CustomAttitudeWidget.qml b/custom-example/res/Custom/Widgets/CustomAttitudeWidget.qml
index c8ab5ed31..7a10b2ee2 100644
--- a/custom-example/res/Custom/Widgets/CustomAttitudeWidget.qml
+++ b/custom-example/res/Custom/Widgets/CustomAttitudeWidget.qml
@@ -9,14 +9,13 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
-import QtGraphicalEffects 1.0
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.FlightMap
Item {
id: root
diff --git a/custom-example/res/Custom/Widgets/CustomIconButton.qml b/custom-example/res/Custom/Widgets/CustomIconButton.qml
index 003628d33..01a0bbd5b 100644
--- a/custom-example/res/Custom/Widgets/CustomIconButton.qml
+++ b/custom-example/res/Custom/Widgets/CustomIconButton.qml
@@ -9,14 +9,13 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QtGraphicalEffects 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Button {
id: _rootButton
diff --git a/custom-example/res/Custom/Widgets/CustomOnOffSwitch.qml b/custom-example/res/Custom/Widgets/CustomOnOffSwitch.qml
index 60e21d8ba..8d3318b15 100644
--- a/custom-example/res/Custom/Widgets/CustomOnOffSwitch.qml
+++ b/custom-example/res/Custom/Widgets/CustomOnOffSwitch.qml
@@ -9,11 +9,11 @@
* @author Gus Grubba
*/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
Rectangle {
id: _root
diff --git a/custom-example/res/Custom/Widgets/CustomQuickButton.qml b/custom-example/res/Custom/Widgets/CustomQuickButton.qml
index 1e8f56d56..59fa3e9f8 100644
--- a/custom-example/res/Custom/Widgets/CustomQuickButton.qml
+++ b/custom-example/res/Custom/Widgets/CustomQuickButton.qml
@@ -9,13 +9,13 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Button {
id: control
diff --git a/custom-example/res/Custom/Widgets/CustomSignalStrength.qml b/custom-example/res/Custom/Widgets/CustomSignalStrength.qml
index e290f4a68..61b124607 100644
--- a/custom-example/res/Custom/Widgets/CustomSignalStrength.qml
+++ b/custom-example/res/Custom/Widgets/CustomSignalStrength.qml
@@ -9,13 +9,13 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
-import QtQuick.Controls 1.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
Item {
width: size
diff --git a/custom-example/res/Custom/Widgets/CustomToolBarButton.qml b/custom-example/res/Custom/Widgets/CustomToolBarButton.qml
index 5e1aa93fe..bd475aff4 100644
--- a/custom-example/res/Custom/Widgets/CustomToolBarButton.qml
+++ b/custom-example/res/Custom/Widgets/CustomToolBarButton.qml
@@ -9,12 +9,12 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Button {
id: button
diff --git a/custom-example/res/Custom/Widgets/CustomVehicleButton.qml b/custom-example/res/Custom/Widgets/CustomVehicleButton.qml
index de864a0c4..fd0aacd3d 100644
--- a/custom-example/res/Custom/Widgets/CustomVehicleButton.qml
+++ b/custom-example/res/Custom/Widgets/CustomVehicleButton.qml
@@ -9,12 +9,12 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Button {
id: button
diff --git a/custom-example/res/CustomFlyViewOverlay.qml b/custom-example/res/CustomFlyViewOverlay.qml
index 422c930a0..539efa947 100644
--- a/custom-example/res/CustomFlyViewOverlay.qml
+++ b/custom-example/res/CustomFlyViewOverlay.qml
@@ -9,16 +9,16 @@
* @author Gus Grubba
*/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
-import Custom.Widgets 1.0
+import Custom.Widgets
Item {
property var parentToolInsets // These insets tell you what screen real estate is available for positioning the controls in your overlay
diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc
index 99940a5b0..fbf6b753b 100644
--- a/qgroundcontrol.qrc
+++ b/qgroundcontrol.qrc
@@ -173,7 +173,7 @@
src/PlanView/RallyPointMapVisuals.qml
src/QmlControls/RCChannelMonitor.qml
src/QmlControls/RCToParamDialog.qml
- src/QmlControls/RoundButton.qml
+ src/QmlControls/QGCRoundButton.qml
src/QmlControls/SectionHeader.qml
src/AutoPilotPlugins/Common/SetupPage.qml
src/ui/toolbar/SignalStrength.qml
diff --git a/src/AnalyzeView/AnalyzePage.qml b/src/AnalyzeView/AnalyzePage.qml
index e6ce777e6..ab223bc77 100644
--- a/src/AnalyzeView/AnalyzePage.qml
+++ b/src/AnalyzeView/AnalyzePage.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
/// Base view control for all Analyze pages
Item {
diff --git a/src/AnalyzeView/AnalyzeView.qml b/src/AnalyzeView/AnalyzeView.qml
index 798006cf8..d6ba1be14 100644
--- a/src/AnalyzeView/AnalyzeView.qml
+++ b/src/AnalyzeView/AnalyzeView.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Window 2.2
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Window
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
Rectangle {
id: _root
@@ -24,8 +24,6 @@ Rectangle {
signal popout()
- ExclusiveGroup { id: setupButtonGroup }
-
readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight
readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth
readonly property real _horizontalMargin: _defaultTextWidth / 2
@@ -87,7 +85,7 @@ Rectangle {
id: subMenu
imageResource: modelData.icon
setupIndicator: false
- exclusiveGroup: setupButtonGroup
+ autoExclusive: true
text: modelData.title
onClicked: {
diff --git a/src/AnalyzeView/GeoTagController.cc b/src/AnalyzeView/GeoTagController.cc
index 164e41b1f..9ebf86f32 100644
--- a/src/AnalyzeView/GeoTagController.cc
+++ b/src/AnalyzeView/GeoTagController.cc
@@ -244,7 +244,7 @@ void GeoTagWorker::run()
}
// Tag images
- int maxIndex = std::min(_imageIndices.count(), _triggerIndices.count());
+ auto maxIndex = std::min(_imageIndices.count(), _triggerIndices.count());
maxIndex = std::min(maxIndex, _imageList.count());
for(int i = 0; i < maxIndex; i++) {
int imageIndex = _imageIndices[i];
diff --git a/src/AnalyzeView/GeoTagPage.qml b/src/AnalyzeView/GeoTagPage.qml
index 7fdaf4917..61659d16b 100644
--- a/src/AnalyzeView/GeoTagPage.qml
+++ b/src/AnalyzeView/GeoTagPage.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
AnalyzePage {
id: geoTagPage
@@ -65,20 +65,18 @@ AnalyzePage {
//-- Log File
QGCButton {
text: qsTr("Select log file")
- onClicked: openLogFile.open()
+ onClicked: openLogFile.openForLoad()
Layout.minimumWidth:_minWidth
Layout.maximumWidth:_maxWidth
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
- FileDialog {
+ QGCFileDialog {
id: openLogFile
title: qsTr("Select log file")
- folder: shortcuts.home
nameFilters: [qsTr("ULog file (*.ulg)"), qsTr("PX4 log file (*.px4log)"), qsTr("All Files (*)")]
defaultSuffix: "ulg"
- selectExisting: true
- onAccepted: {
- geoController.logFile = openLogFile.fileUrl
+ onAcceptedForLoad: (file) => {
+ geoController.logFile = openLogFile.file
close()
}
}
@@ -93,19 +91,17 @@ AnalyzePage {
//-- Image Directory
QGCButton {
text: qsTr("Select image directory")
- onClicked: selectImageDir.open()
+ onClicked: selectImageDir.openForLoad()
Layout.minimumWidth:_minWidth
Layout.maximumWidth:_maxWidth
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
- FileDialog {
+ QGCFileDialog {
id: selectImageDir
title: qsTr("Select image directory")
- folder: shortcuts.home
selectFolder: true
- selectExisting: true
- onAccepted: {
- geoController.imageDirectory = selectImageDir.folder
+ onAcceptedForLoad: (file) => {
+ geoController.imageDirectory = selectImageDir.file
close()
}
}
@@ -120,19 +116,17 @@ AnalyzePage {
//-- Save Directory
QGCButton {
text: qsTr("(Optionally) Select save directory")
- onClicked: selectDestDir.open()
+ onClicked: selectDestDir.openForLoad()
Layout.minimumWidth:_minWidth
Layout.maximumWidth:_maxWidth
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
- FileDialog {
+ QGCFileDialog {
id: selectDestDir
title: qsTr("Select save directory")
- folder: shortcuts.home
selectFolder: true
- selectExisting: true
- onAccepted: {
- geoController.saveDirectory = selectDestDir.folder
+ onAcceptedForLoad: (file) => {
+ geoController.saveDirectory = selectDestDir.file
close()
}
}
diff --git a/src/AnalyzeView/LogDownloadController.cc b/src/AnalyzeView/LogDownloadController.cc
index a5cd0609d..b21a8d113 100644
--- a/src/AnalyzeView/LogDownloadController.cc
+++ b/src/AnalyzeView/LogDownloadController.cc
@@ -724,7 +724,9 @@ QGCLogModel::QGCLogModel(QObject* parent)
QGCLogEntry*
QGCLogModel::get(int index)
{
+ qDebug() << "QGCLogModel::get" << index;
if (index < 0 || index >= _logEntries.count()) {
+ qDebug() << "QGCLogModel::get failed";
return nullptr;
}
return _logEntries[index];
@@ -795,3 +797,9 @@ QGCLogModel::roleNames() const {
roles[ObjectRole] = "logEntry";
return roles;
}
+
+int QGCLogModel::columnCount(const QModelIndex &parent) const
+{
+ Q_UNUSED(parent);
+ return 4;
+}
diff --git a/src/AnalyzeView/LogDownloadController.h b/src/AnalyzeView/LogDownloadController.h
index fcb9fd2e2..b24ae1ef1 100644
--- a/src/AnalyzeView/LogDownloadController.h
+++ b/src/AnalyzeView/LogDownloadController.h
@@ -52,6 +52,7 @@ public:
int rowCount (const QModelIndex & parent = QModelIndex()) const;
QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const;
+ int columnCount (const QModelIndex &parent) const;
signals:
void countChanged ();
diff --git a/src/AnalyzeView/LogDownloadPage.qml b/src/AnalyzeView/LogDownloadPage.qml
index 863274ac3..186d44b7b 100644
--- a/src/AnalyzeView/LogDownloadPage.qml
+++ b/src/AnalyzeView/LogDownloadPage.qml
@@ -7,16 +7,17 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import Qt.labs.qmlmodels
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
AnalyzePage {
id: logDownloadPage
@@ -26,7 +27,7 @@ AnalyzePage {
property real _margin: ScreenTools.defaultFontPixelWidth
property real _butttonWidth: ScreenTools.defaultFontPixelWidth * 10
- QGCPalette { id: palette; colorGroupEnabled: enabled }
+ QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
Component {
id: pageComponent
@@ -48,74 +49,106 @@ AnalyzePage {
}
}
- TableView {
- id: tableView
- Layout.fillHeight: true
- model: logController.model
- selectionMode: SelectionMode.MultiSelection
+ ColumnLayout {
Layout.fillWidth: true
+ Layout.fillHeight: true
+ spacing: 0
- TableViewColumn {
- title: qsTr("Id")
- width: ScreenTools.defaultFontPixelWidth * 6
- horizontalAlignment: Text.AlignHCenter
- delegate : Text {
- color: styleData.textColor
- horizontalAlignment: Text.AlignHCenter
- text: {
- var o = logController.model.get(styleData.row)
- return o ? o.id : ""
- }
- }
+ HorizontalHeaderView {
+ Layout.fillWidth: true
+ model: [ qsTr("Id"), qsTr("Date"), qsTr("Size"), qsTr("Status") ]
+ syncView: tableView
+ clip: true
}
- TableViewColumn {
- title: qsTr("Date")
- width: ScreenTools.defaultFontPixelWidth * 34
- horizontalAlignment: Text.AlignHCenter
- delegate: Text {
- color: styleData.textColor
- text: {
- var o = logController.model.get(styleData.row)
- if (o) {
- //-- Have we received this entry already?
- if(logController.model.get(styleData.row).received) {
- var d = logController.model.get(styleData.row).time
- if(d.getUTCFullYear() < 2010)
- return qsTr("Date Unknown")
- else
- return d.toLocaleString(undefined, "short")
+ TableView {
+ id: tableView
+ Layout.fillWidth: true
+ model: logController.model
+ selectionBehavior: TableView.SelectRows
+ selectionMode: TableView.ExtendedSelection
+ columnWidthProvider: columnWidth
+ selectionModel: ItemSelectionModel {}
+
+ property int modelCount: model.count
+
+ onModelCountChanged: console.log("modelCount", modelCount)
+
+ onColumnsChanged: console.log("columns", columns)
+
+ function columnWidth(column) {
+ switch (column) {
+ case 0:
+ return ScreenTools.defaultFontPixelWidth * 6
+ case 1:
+ return ScreenTools.defaultFontPixelWidth * 34
+ case 2:
+ return ScreenTools.defaultFontPixelWidth * 18
+ case 3:
+ return ScreenTools.defaultFontPixelWidth * 22
+ default:
+ return 0
+ }
+ }
+
+ delegate: DelegateChooser {
+ DelegateChoice {
+ column: 0
+ delegate : Text {
+ color: qgcPal.text
+ //horizontalAlignment: Text.AlignHCenter
+ Component.onCompleted: console.log("index", index, text)
+ text: {
+ var o = logController.model.get(index)
+ return o ? o.id : ""
}
}
- return ""
}
- }
- }
- TableViewColumn {
- title: qsTr("Size")
- width: ScreenTools.defaultFontPixelWidth * 18
- horizontalAlignment: Text.AlignHCenter
- delegate : Text {
- color: styleData.textColor
- horizontalAlignment: Text.AlignRight
- text: {
- var o = logController.model.get(styleData.row)
- return o ? o.sizeStr : ""
+ DelegateChoice {
+ column: 1
+ delegate: Text {
+ color: qgcPal.text
+ text: {
+ var o = logController.model.get(index)
+ if (o) {
+ //-- Have we received this entry already?
+ if(logController.model.get(index).received) {
+ var d = logController.model.get(index).time
+ if(d.getUTCFullYear() < 2010)
+ return qsTr("Date Unknown")
+ else
+ return d.toLocaleString(undefined, "short")
+ }
+ }
+ return ""
+ }
+ }
}
- }
- }
- TableViewColumn {
- title: qsTr("Status")
- width: ScreenTools.defaultFontPixelWidth * 22
- horizontalAlignment: Text.AlignHCenter
- delegate : Text {
- color: styleData.textColor
- horizontalAlignment: Text.AlignHCenter
- text: {
- var o = logController.model.get(styleData.row)
- return o ? o.status : ""
+ DelegateChoice {
+ column: 2
+ delegate : Text {
+ color: qgcPal.text
+ //horizontalAlignment: Text.AlignRight
+ Component.onCompleted: console.log("size", index, logController.model.get(index).sizeStr)
+ text: {
+ var o = logController.model.get(index)
+ return o ? o.sizeStr : ""
+ }
+ }
+ }
+
+ DelegateChoice {
+ column: 3
+ delegate : Text {
+ color: qgcPal.text
+ //horizontalAlignment: Text.AlignHCenter
+ text: {
+ var o = logController.model.get(index)
+ return o ? o.status : ""
+ }
+ }
}
}
}
@@ -136,7 +169,7 @@ AnalyzePage {
}
}
QGCButton {
- enabled: !logController.requestingList && !logController.downloadingLogs && tableView.selection.count > 0
+ enabled: !logController.requestingList && !logController.downloadingLogs && tableView.selectionModel.selectedIndexes.count > 0
text: qsTr("Download")
width: _butttonWidth
onClicked: {
@@ -146,7 +179,7 @@ AnalyzePage {
if (o) o.selected = false
}
//-- Flag selected log files
- tableView.selection.forEach(function(rowIndex){
+ tableView.selectionModel.selectedIndexes.forEach(function(rowIndex){
var o = logController.model.get(rowIndex)
if (o) o.selected = true
})
@@ -155,7 +188,6 @@ AnalyzePage {
logController.download()
} else {
fileDialog.title = qsTr("Select save directory")
- fileDialog.selectExisting = true
fileDialog.folder = QGroundControl.settingsManager.appSettings.logSavePath
fileDialog.selectFolder = true
fileDialog.openForLoad()
@@ -163,7 +195,7 @@ AnalyzePage {
}
QGCFileDialog {
id: fileDialog
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
logController.download(file)
close()
}
@@ -175,7 +207,7 @@ AnalyzePage {
width: _butttonWidth
onClicked: mainWindow.showMessageDialog(qsTr("Delete All Log Files"),
qsTr("All log files will be erased permanently. Is this really what you want?"),
- StandardButton.Yes | StandardButton.No,
+ Dialog.Yes | Dialog.No,
function() { logController.eraseAll() })
}
QGCButton {
diff --git a/src/AnalyzeView/MAVLinkInspectorController.cc b/src/AnalyzeView/MAVLinkInspectorController.cc
index 93107db27..6c3352928 100644
--- a/src/AnalyzeView/MAVLinkInspectorController.cc
+++ b/src/AnalyzeView/MAVLinkInspectorController.cc
@@ -14,8 +14,6 @@
QGC_LOGGING_CATEGORY(MAVLinkInspectorLog, "MAVLinkInspectorLog")
-QT_CHARTS_USE_NAMESPACE
-
Q_DECLARE_METATYPE(QAbstractSeries*)
#define UPDATE_FREQUENCY (1000 / 15) // 15Hz
diff --git a/src/AnalyzeView/MAVLinkInspectorController.h b/src/AnalyzeView/MAVLinkInspectorController.h
index 83736d842..3486ec557 100644
--- a/src/AnalyzeView/MAVLinkInspectorController.h
+++ b/src/AnalyzeView/MAVLinkInspectorController.h
@@ -20,12 +20,10 @@
#include
#include
#include
-#include
+#include
Q_DECLARE_LOGGING_CATEGORY(MAVLinkInspectorLog)
-QT_CHARTS_USE_NAMESPACE
-
class QGCMAVLinkMessage;
class QGCMAVLinkSystem;
class MAVLinkChartController;
diff --git a/src/AnalyzeView/MAVLinkInspectorPage.qml b/src/AnalyzeView/MAVLinkInspectorPage.qml
index a0b0ee03e..49f3b0fdd 100644
--- a/src/AnalyzeView/MAVLinkInspectorPage.qml
+++ b/src/AnalyzeView/MAVLinkInspectorPage.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
-import QtQuick.Dialogs 1.3
-import QtQuick.Window 2.2
-import QtCharts 2.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
+import QtQuick.Window
+import QtCharts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
AnalyzePage {
headerComponent: headerComponent
diff --git a/src/AnalyzeView/MavlinkConsolePage.qml b/src/AnalyzeView/MavlinkConsolePage.qml
index 550dbadaf..9832954b5 100644
--- a/src/AnalyzeView/MavlinkConsolePage.qml
+++ b/src/AnalyzeView/MavlinkConsolePage.qml
@@ -7,19 +7,19 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.3
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
AnalyzePage {
id: mavlinkConsolePage
@@ -128,12 +128,18 @@ AnalyzePage {
Layout.preferredWidth: parent.width
Layout.fillHeight: true
readOnly: _separateCommandInput
- frameVisible: false
textFormat: TextEdit.RichText
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhMultiLine
text: "> "
focus: true
+ color: qgcPal.text
+ selectedTextColor: qgcPal.windowShade
+ selectionColor: qgcPal.text
+ font.pointSize: ScreenTools.defaultFontPointSize
+ font.family: ScreenTools.fixedFontFamily
+ // FIXME-QT6 - menu: not supported directly
+ /*
menu: Menu {
id: contextMenu
MenuItem {
@@ -149,15 +155,9 @@ AnalyzePage {
}
}
}
+ */
- style: TextAreaStyle {
- textColor: qgcPal.text
- backgroundColor: qgcPal.windowShade
- selectedTextColor: qgcPal.windowShade
- selectionColor: qgcPal.text
- font.pointSize: ScreenTools.defaultFontPointSize
- font.family: ScreenTools.fixedFontFamily
- }
+ background: Rectangle { color: qgcPal.windowShade }
Keys.onPressed: {
if (event.key == Qt.Key_Tab) { // ignore tabs
@@ -253,7 +253,7 @@ AnalyzePage {
onClicked: {
// disable middle-click pasting (we could add support for that if needed)
}
- onWheel: {
+ onWheel: (wheel) => {
// increase scrolling speed (the default is a single line)
var numLines = 4
var flickable = textConsole.flickableItem
diff --git a/src/AnalyzeView/PX4LogParser.cc b/src/AnalyzeView/PX4LogParser.cc
index 437c41d9b..5528e7367 100644
--- a/src/AnalyzeView/PX4LogParser.cc
+++ b/src/AnalyzeView/PX4LogParser.cc
@@ -42,7 +42,7 @@ bool PX4LogParser::getTagsFromLog(QByteArray& log, QList 3 || globals.activeVehicle.firmwareMinorVersion > 5 || globals.activeVehicle.firmwarePatchVersion >= 2)
@@ -219,6 +219,8 @@ SetupPage {
property var _fact: controller.getParameterFact(-1, "MNT_JSTICK_SPD")
property bool _loadComplete: false
+ /*
+ // FIXME-QT6 - Controls 2 doesn't style controls this way
// Override style to make handles smaller than default
style: SliderStyle {
handle: Rectangle {
@@ -233,6 +235,7 @@ SetupPage {
property real _radius: Math.round(ScreenTools.defaultFontPixelHeight * 0.35)
}
}
+ */
onValueChanged: {
if (_loadComplete) {
@@ -242,15 +245,15 @@ SetupPage {
MouseArea {
anchors.fill: parent
- onWheel: {
+ onWheel: (wheel) => {
// do nothing
wheel.accepted = true;
}
- onPressed: {
+ onPressed: (mouse) => {
// propogate/accept
mouse.accepted = false;
}
- onReleased: {
+ onReleased: (mouse) => {
// propogate/accept
mouse.accepted = false;
}
@@ -294,7 +297,7 @@ SetupPage {
id: rectangle
height: innerColumn.height + _margins*2
width: innerColumn.width + _margins*2
- color: palette.windowShade
+ color: qgcPal.windowShade
// Section Content - 3 Rows
Column {
@@ -458,7 +461,7 @@ SetupPage {
anchors.top: settingsLabel.bottom
width: gimbalModeCombo.x + gimbalModeCombo.width + _margins
height: gimbalModeCombo.y + gimbalModeCombo.height + _margins
- color: palette.windowShade
+ color: qgcPal.windowShade
QGCLabel {
id: gimbalTypeLabel
diff --git a/src/AutoPilotPlugins/APM/APMFlightModesComponent.qml b/src/AutoPilotPlugins/APM/APMFlightModesComponent.qml
index 11b3f4069..5714db3b7 100644
--- a/src/AutoPilotPlugins/APM/APMFlightModesComponent.qml
+++ b/src/AutoPilotPlugins/APM/APMFlightModesComponent.qml
@@ -8,16 +8,16 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
SetupPage {
id: flightModePage
diff --git a/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml b/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml
index 603c13347..af562e8b2 100644
--- a/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml
+++ b/src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/APM/APMFollowComponent.qml b/src/AutoPilotPlugins/APM/APMFollowComponent.qml
index 135563f49..37dc3c6db 100644
--- a/src/AutoPilotPlugins/APM/APMFollowComponent.qml
+++ b/src/AutoPilotPlugins/APM/APMFollowComponent.qml
@@ -8,18 +8,18 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
SetupPage {
id: followPage
@@ -432,7 +432,7 @@ SetupPage {
MouseArea {
anchors.fill: parent
- onClicked: {
+ onClicked: (mouse) => {
// Translate x,y to centered
var x = mouse.x - (width / 2)
var y = (height - mouse.y) - (height / 2)
diff --git a/src/AutoPilotPlugins/APM/APMFollowComponentSummary.qml b/src/AutoPilotPlugins/APM/APMFollowComponentSummary.qml
index 7451003ed..4d0c8fdc1 100644
--- a/src/AutoPilotPlugins/APM/APMFollowComponentSummary.qml
+++ b/src/AutoPilotPlugins/APM/APMFollowComponentSummary.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/APM/APMHeliComponent.qml b/src/AutoPilotPlugins/APM/APMHeliComponent.qml
index 510034b6a..e71bcb8d7 100644
--- a/src/AutoPilotPlugins/APM/APMHeliComponent.qml
+++ b/src/AutoPilotPlugins/APM/APMHeliComponent.qml
@@ -7,16 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtGraphicalEffects 1.0
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
SetupPage {
id: safetyPage
diff --git a/src/AutoPilotPlugins/APM/APMLightsComponent.qml b/src/AutoPilotPlugins/APM/APMLightsComponent.qml
index 99590f65e..7528cf1a9 100644
--- a/src/AutoPilotPlugins/APM/APMLightsComponent.qml
+++ b/src/AutoPilotPlugins/APM/APMLightsComponent.qml
@@ -8,15 +8,15 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
SetupPage {
id: lightsPage
diff --git a/src/AutoPilotPlugins/APM/APMLightsComponentSummary.qml b/src/AutoPilotPlugins/APM/APMLightsComponentSummary.qml
index 826c35c35..0deaa049a 100644
--- a/src/AutoPilotPlugins/APM/APMLightsComponentSummary.qml
+++ b/src/AutoPilotPlugins/APM/APMLightsComponentSummary.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/APM/APMMotorComponent.cc b/src/AutoPilotPlugins/APM/APMMotorComponent.cc
index 45698710d..8e03c147d 100644
--- a/src/AutoPilotPlugins/APM/APMMotorComponent.cc
+++ b/src/AutoPilotPlugins/APM/APMMotorComponent.cc
@@ -31,5 +31,5 @@ QString APMMotorComponent::motorIndexToLetter(int index)
{
char letter = 'A';
- return QString(letter + index);
+ return QString(char(letter + index));
}
diff --git a/src/AutoPilotPlugins/APM/APMMotorComponent.qml b/src/AutoPilotPlugins/APM/APMMotorComponent.qml
index cd39f3c42..d9325bccb 100644
--- a/src/AutoPilotPlugins/APM/APMMotorComponent.qml
+++ b/src/AutoPilotPlugins/APM/APMMotorComponent.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.ScreenTools
SetupPage {
id: motorPage
@@ -62,11 +62,11 @@ SetupPage {
id: slider
height: ScreenTools.defaultFontPixelHeight * _sliderHeight
orientation: Qt.Vertical
- minimumValue: 0
- maximumValue: 100
+ from: 0
+ to: 100
stepSize: 1
value: 0
- updateValueWhileDragging: false
+ live: false
onValueChanged: {
controller.vehicle.motorTest(index + 1, value, value == 0 ? 0 : _motorTimeoutSecs, true)
@@ -100,11 +100,11 @@ SetupPage {
id: allSlider
height: ScreenTools.defaultFontPixelHeight * _sliderHeight
orientation: Qt.Vertical
- minimumValue: 0
- maximumValue: 100
+ from: 0
+ to: 100
stepSize: 1
value: 0
- updateValueWhileDragging: false
+ live: false
onValueChanged: {
for (var sliderIndex=0; sliderIndex {
// do nothing
wheel.accepted = true;
}
- onPressed: {
+ onPressed: (mouse) => {
// propogate/accept
mouse.accepted = false;
}
- onReleased: {
+ onReleased: (mouse) => {
// propogate/accept
mouse.accepted = false;
}
diff --git a/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml b/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml
index f77a0f6aa..5eb771965 100644
--- a/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml
+++ b/src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml
@@ -8,16 +8,16 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
SetupPage {
id: tuningPage
@@ -156,12 +156,12 @@ SetupPage {
text: qsTr("Slide to the right if the copter is sluggish or slide to the left if the copter is twitchy")
}
- Slider {
+ QGCSlider {
id: rollPitch
anchors.left: parent.left
anchors.right: parent.right
- minimumValue: 0.08
- maximumValue: 0.4
+ from: 0.08
+ to: 0.4
stepSize: 0.01
tickmarksEnabled: true
@@ -189,12 +189,12 @@ SetupPage {
text: qsTr("Slide to the right to climb more aggressively or slide to the left to climb more gently")
}
- Slider {
+ QGCSlider {
id: climb
anchors.left: parent.left
anchors.right: parent.right
- minimumValue: 0.3
- maximumValue: 1.0
+ from: 0.3
+ to: 1.0
stepSize: 0.02
tickmarksEnabled: true
value: _rateClimbP.value
@@ -222,12 +222,12 @@ SetupPage {
text: qsTr("Slide to the left for soft control, slide to the right for crisp control")
}
- Slider {
+ QGCSlider {
id: atcInputTC
anchors.left: parent.left
anchors.right: parent.right
- minimumValue: _atcInputTC.min
- maximumValue: _atcInputTC.max
+ from: _atcInputTC.min
+ to: _atcInputTC.max
stepSize: _atcInputTC.increment
tickmarksEnabled: true
@@ -252,11 +252,11 @@ SetupPage {
text: qsTr("Adjust the amount the motors spin to indicate armed")
}
- Slider {
+ QGCSlider {
anchors.left: parent.left
anchors.right: parent.right
- minimumValue: 0
- maximumValue: Math.max(0.3, _motSpinArm.rawValue)
+ from: 0
+ to: Math.max(0.3, _motSpinArm.rawValue)
stepSize: 0.01
tickmarksEnabled: true
value: _motSpinArm.rawValue
@@ -288,11 +288,11 @@ SetupPage {
visible: _motSpinMin.rawValue < _motSpinArm.rawValue
}
- Slider {
+ QGCSlider {
anchors.left: parent.left
anchors.right: parent.right
- minimumValue: 0
- maximumValue: Math.max(0.3, _motSpinMin.rawValue)
+ from: 0
+ to: Math.max(0.3, _motSpinMin.rawValue)
stepSize: 0.01
tickmarksEnabled: true
value: _motSpinMin.rawValue
diff --git a/src/AutoPilotPlugins/APM/APMTuningComponentSub.qml b/src/AutoPilotPlugins/APM/APMTuningComponentSub.qml
index 8a9394424..ac4992193 100644
--- a/src/AutoPilotPlugins/APM/APMTuningComponentSub.qml
+++ b/src/AutoPilotPlugins/APM/APMTuningComponentSub.qml
@@ -8,14 +8,14 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
SetupPage {
id: tuningPage
@@ -30,7 +30,7 @@ SetupPage {
FactPanelController { id: controller; }
- QGCPalette { id: palette; colorGroupEnabled: true }
+ QGCPalette { id: qgcPal; colorGroupEnabled: true }
property real _margins: ScreenTools.defaultFontPixelHeight
@@ -65,7 +65,7 @@ SetupPage {
anchors.left: parent.left
anchors.right: parent.right
height: posColumn.height + _margins*2
- color: palette.windowShade
+ color: qgcPal.windowShade
Column {
id: posColumn
@@ -101,7 +101,7 @@ SetupPage {
anchors.left: parent.left
anchors.right: parent.right
height: velColumn.height + _margins*2
- color: palette.windowShade
+ color: qgcPal.windowShade
Component {
id: velColumnUpTo36
@@ -167,7 +167,7 @@ SetupPage {
anchors.left: parent.left
anchors.right: parent.right
height: wpnavColumn.height + _margins*2
- color: palette.windowShade
+ color: qgcPal.windowShade
// WPNAV parameters up to 3.5
Component {
diff --git a/src/AutoPilotPlugins/Common/ESP8266Component.qml b/src/AutoPilotPlugins/Common/ESP8266Component.qml
index ec3f9ad05..536f3a208 100644
--- a/src/AutoPilotPlugins/Common/ESP8266Component.qml
+++ b/src/AutoPilotPlugins/Common/ESP8266Component.qml
@@ -8,18 +8,18 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
Item {
@@ -446,16 +446,19 @@ Item {
MessageDialog {
id: rebootDialog
visible: false
- icon: StandardIcon.Warning
- standardButtons: StandardButton.Yes | StandardButton.No
+ buttons: MessageDialog.Yes | MessageDialog.No
title: qsTr("Reboot WiFi Bridge")
text: qsTr("This will restart the WiFi Bridge so the settings you've changed can take effect. Note that you may have to change your computer WiFi settings and QGroundControl link settings to match these changes. Are you sure you want to restart it?")
- onYes: {
- controller.reboot()
- rebootDialog.visible = false
- }
- onNo: {
- rebootDialog.visible = false
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ controller.reboot()
+ rebootDialog.visible = false
+ break;
+ case MessageDialog.No:
+ rebootDialog.visible = false
+ break;
+ }
}
}
}
diff --git a/src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml b/src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml
index 2b4c8a99a..2a149d906 100644
--- a/src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml
+++ b/src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml
@@ -1,11 +1,11 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Controllers
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/Common/MotorComponent.qml b/src/AutoPilotPlugins/Common/MotorComponent.qml
index 95812d7a2..d91a599c7 100644
--- a/src/AutoPilotPlugins/Common/MotorComponent.qml
+++ b/src/AutoPilotPlugins/Common/MotorComponent.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.ScreenTools
SetupPage {
id: motorPage
@@ -62,11 +62,11 @@ SetupPage {
id: slider
height: ScreenTools.defaultFontPixelHeight * _sliderHeight
orientation: Qt.Vertical
- minimumValue: 0
- maximumValue: 100
+ from: 0
+ to: 100
stepSize: 1
value: 0
- updateValueWhileDragging: false
+ live: false
onValueChanged: {
controller.vehicle.motorTest(index + 1, value, value == 0 ? 0 : _motorTimeoutSecs, true)
@@ -100,11 +100,11 @@ SetupPage {
id: allSlider
height: ScreenTools.defaultFontPixelHeight * _sliderHeight
orientation: Qt.Vertical
- minimumValue: 0
- maximumValue: 100
+ from: 0
+ to: 100
stepSize: 1
value: 0
- updateValueWhileDragging: false
+ live: false
onValueChanged: {
for (var sliderIndex=0; sliderIndex rollLoader.item.rcValue = rcValue
}
}
@@ -228,7 +228,7 @@ SetupPage {
Connections {
target: controller
- onPitchChannelRCValueChanged: pitchLoader.item.rcValue = rcValue
+ onPitchChannelRCValueChanged: (rcValue) => pitchLoader.item.rcValue = rcValue
}
}
@@ -257,7 +257,7 @@ SetupPage {
Connections {
target: controller
- onYawChannelRCValueChanged: yawLoader.item.rcValue = rcValue
+ onYawChannelRCValueChanged: (rcValue) => yawLoader.item.rcValue = rcValue
}
}
@@ -285,7 +285,7 @@ SetupPage {
Connections {
target: controller
- onThrottleChannelRCValueChanged: throttleLoader.item.rcValue = rcValue
+ onThrottleChannelRCValueChanged: (rcValue) => throttleLoader.item.rcValue = rcValue
}
}
} // Column - Attitude Control labels
@@ -323,7 +323,7 @@ SetupPage {
mainWindow.showMessageDialog(qsTr("Zero Trims"),
qsTr("Before calibrating you should zero all your trims and subtrims. Click Ok to start Calibration.\n\n%1").arg(
(QGroundControl.multiVehicleManager.activeVehicle.px4Firmware ? "" : qsTr("Please ensure all motor power is disconnected AND all props are removed from the vehicle."))),
- StandardButton.Ok,
+ Dialog.Ok,
function() { controller.nextButtonClicked() })
}
} else {
@@ -392,7 +392,7 @@ SetupPage {
text: qsTr("Copy Trims")
onClicked: mainWindow.showMessageDialog(qsTr("Copy Trims"),
qsTr("Center your sticks and move throttle all the way down, then press Ok to copy trims. After pressing Ok, reset the trims on your radio back to zero."),
- StandardButton.Ok | StandardButton.Cancel,
+ Dialog.Ok | Dialog.Cancel,
function() { controller.copyTrims() })
}
}
diff --git a/src/AutoPilotPlugins/Common/SetupPage.qml b/src/AutoPilotPlugins/Common/SetupPage.qml
index cf3a7209a..f6eb756c0 100644
--- a/src/AutoPilotPlugins/Common/SetupPage.qml
+++ b/src/AutoPilotPlugins/Common/SetupPage.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
/// Base view control for all Setup pages
Item {
diff --git a/src/AutoPilotPlugins/Common/SyslinkComponent.qml b/src/AutoPilotPlugins/Common/SyslinkComponent.qml
index f58ea6441..0e448352f 100644
--- a/src/AutoPilotPlugins/Common/SyslinkComponent.qml
+++ b/src/AutoPilotPlugins/Common/SyslinkComponent.qml
@@ -9,16 +9,16 @@
-import QtQuick 2.2
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
SetupPage {
id: syslinkPage
diff --git a/src/AutoPilotPlugins/PX4/ActuatorComponent.qml b/src/AutoPilotPlugins/PX4/ActuatorComponent.qml
index 6bd85ef26..40baa2c7a 100644
--- a/src/AutoPilotPlugins/PX4/ActuatorComponent.qml
+++ b/src/AutoPilotPlugins/PX4/ActuatorComponent.qml
@@ -1,13 +1,13 @@
-import QtQuick 2.12
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.FactSystem
+import QGroundControl.ScreenTools
SetupPage {
id: actuatorPage
@@ -163,7 +163,7 @@ SetupPage {
cache: false
MouseArea {
anchors.fill: parent
- onClicked: {
+ onClicked: (mouse) => {
if (mouse.button == Qt.LeftButton) {
actuators.imageClicked(mouse.x, mouse.y);
}
@@ -379,22 +379,26 @@ SetupPage {
MessageDialog {
id: motorAssignmentConfirmDialog
visible: false
- icon: StandardIcon.Warning
- standardButtons: StandardButton.Yes | StandardButton.No
+ //icon: StandardIcon.Warning
+ buttons: MessageDialog.Yes | MessageDialog.No
title: qsTr("Motor Order Identification and Assignment")
- text: actuators.motorAssignmentMessage
- onYes: {
- console.log(actuators.motorAssignmentActive)
- actuators.startMotorAssignment()
+ text: actuators.motorAssignmentMessage
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ console.log(actuators.motorAssignmentActive)
+ actuators.startMotorAssignment()
+ break;
+ }
}
}
MessageDialog {
id: motorAssignmentFailureDialog
visible: false
- icon: StandardIcon.Critical
- standardButtons: StandardButton.Ok
+ //icon: StandardIcon.Critical
+ buttons: MessageDialog.Ok
title: qsTr("Error")
- text: actuators.motorAssignmentMessage
+ text: actuators.motorAssignmentMessage
}
}
QGCButton {
diff --git a/src/AutoPilotPlugins/PX4/ActuatorFact.qml b/src/AutoPilotPlugins/PX4/ActuatorFact.qml
index b235ad6d0..cc279feee 100644
--- a/src/AutoPilotPlugins/PX4/ActuatorFact.qml
+++ b/src/AutoPilotPlugins/PX4/ActuatorFact.qml
@@ -1,11 +1,11 @@
-import QtQuick 2.12
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
Loader {
property var fact
diff --git a/src/AutoPilotPlugins/PX4/ActuatorSlider.qml b/src/AutoPilotPlugins/PX4/ActuatorSlider.qml
index ea60e04d3..59245b5fe 100644
--- a/src/AutoPilotPlugins/PX4/ActuatorSlider.qml
+++ b/src/AutoPilotPlugins/PX4/ActuatorSlider.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.12
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
Column {
property var channel
@@ -37,11 +37,11 @@ Column {
QGCSlider {
id: channelSlider
orientation: Qt.Vertical
- minimumValue: snap ? channel.min - snapRange : channel.min
- maximumValue: channel.max
+ from: snap ? channel.min - snapRange : channel.min
+ to: channel.max
stepSize: (channel.max-channel.min)/100
value: defaultVal
- updateValueWhileDragging: true
+ live: true
anchors.horizontalCenter: parent.horizontalCenter
height: ScreenTools.defaultFontPixelHeight * _sliderHeight
indicatorBarVisible: sendTimer.running
diff --git a/src/AutoPilotPlugins/PX4/AirframeComponent.qml b/src/AutoPilotPlugins/PX4/AirframeComponent.qml
index d32547564..abff68cb7 100644
--- a/src/AutoPilotPlugins/PX4/AirframeComponent.qml
+++ b/src/AutoPilotPlugins/PX4/AirframeComponent.qml
@@ -8,17 +8,17 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
SetupPage {
id: airframePage
@@ -122,7 +122,7 @@ SetupPage {
qsTr("Clicking 'Apply' will save the changes you have made to your airframe configuration.
\
All vehicle parameters other than Radio Calibration will be reset.
\
Your vehicle will also be restarted in order to complete the process."),
- StandardButton.Apply | StandardButton.Cancel,
+ Dialog.Apply | Dialog.Cancel,
function() { controller.changeAutostart() })
}
@@ -139,7 +139,7 @@ SetupPage {
width: parent.width
spacing: _boxSpace
- ExclusiveGroup {
+ ButtonGroup {
id: airframeTypeExclusive
}
@@ -194,7 +194,7 @@ SetupPage {
// Although this item is invisible we still use it to manage state
id: airframeCheckBox
checked: modelData.name === controller.currentAirframeType
- exclusiveGroup: airframeTypeExclusive
+ buttonGroup: airframeTypeExclusive
visible: false
onCheckedChanged: {
diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml
index 195ca843a..9e26382f5 100644
--- a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml
+++ b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml
@@ -1,11 +1,11 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.Palette
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/PX4/BatteryParams.qml b/src/AutoPilotPlugins/PX4/BatteryParams.qml
index 9bbf69c22..ad09acfbd 100644
--- a/src/AutoPilotPlugins/PX4/BatteryParams.qml
+++ b/src/AutoPilotPlugins/PX4/BatteryParams.qml
@@ -7,17 +7,17 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
// Exposes the set of battery parameters for new and old firmwares
// Older firmware: BAT_* naming
diff --git a/src/AutoPilotPlugins/PX4/CameraComponent.qml b/src/AutoPilotPlugins/PX4/CameraComponent.qml
index 118dc06d6..0629bee98 100644
--- a/src/AutoPilotPlugins/PX4/CameraComponent.qml
+++ b/src/AutoPilotPlugins/PX4/CameraComponent.qml
@@ -8,17 +8,16 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
SetupPage {
id: cameraPage
diff --git a/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml b/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
index ce94525b0..5115ea608 100644
--- a/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
+++ b/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml
index 3a8be318b..ca0848562 100644
--- a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml
+++ b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml
@@ -1,11 +1,11 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/PX4/PX4FlightBehaviorCopter.qml b/src/AutoPilotPlugins/PX4/PX4FlightBehaviorCopter.qml
index 1d831f633..82fbda59e 100644
--- a/src/AutoPilotPlugins/PX4/PX4FlightBehaviorCopter.qml
+++ b/src/AutoPilotPlugins/PX4/PX4FlightBehaviorCopter.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
SetupPage {
id: flightBehavior
diff --git a/src/AutoPilotPlugins/PX4/PX4FlightModes.qml b/src/AutoPilotPlugins/PX4/PX4FlightModes.qml
index 854af1b80..668ee10a9 100644
--- a/src/AutoPilotPlugins/PX4/PX4FlightModes.qml
+++ b/src/AutoPilotPlugins/PX4/PX4FlightModes.qml
@@ -8,18 +8,18 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
/// PX4 Flight Mode configuration. This control will load either the Simple or Advanced Flight Mode config
/// based on current parameter settings.
diff --git a/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml b/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml
index d766b4d38..33a610450 100644
--- a/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml
+++ b/src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml b/src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
index 26e7901cd..48afd80a2 100644
--- a/src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
+++ b/src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
Item {
id: root
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml
index 4dc431469..275eae21e 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml
@@ -7,12 +7,12 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.Controls
SetupPage {
id: tuningPage
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml
index a4ab9d116..a0a531c69 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAll.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.ScreenTools
Item {
width: availableWidth
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml
index 7a7f94654..f03af43e0 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterAttitude.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
ColumnLayout {
width: availableWidth
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml
index ee68beef8..2d098bb9a 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterPosition.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
ColumnLayout {
width: availableWidth
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml
index e15b40efc..931099ac8 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
ColumnLayout {
width: availableWidth
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml
index e60ba2228..f761ffbd0 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
ColumnLayout {
width: availableWidth
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml
index 2b67e51aa..6868b344d 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml
@@ -7,12 +7,12 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.Controls
SetupPage {
id: tuningPage
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml
index 4ea95bd5a..a6b028999 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAll.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.ScreenTools
Item {
width: availableWidth
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAttitude.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAttitude.qml
index f73e15fc6..7809086eb 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAttitude.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneAttitude.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
ColumnLayout {
width: availableWidth
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneRate.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneRate.qml
index f35e19536..bd7bc336a 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneRate.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneRate.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
ColumnLayout {
width: availableWidth
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml
index c2475c723..17953cfc3 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentPlaneTECS.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
ColumnLayout {
width: availableWidth
diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml
index b4d0c5ed8..b7bfd62ee 100644
--- a/src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml
+++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml
@@ -8,12 +8,12 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.ScreenTools
SetupPage {
id: tuningPage
diff --git a/src/AutoPilotPlugins/PX4/PowerComponent.qml b/src/AutoPilotPlugins/PX4/PowerComponent.qml
index 659600b8f..87ee9903d 100644
--- a/src/AutoPilotPlugins/PX4/PowerComponent.qml
+++ b/src/AutoPilotPlugins/PX4/PowerComponent.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.PX4 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
+import QGroundControl.PX4
// Note: This setup supports back compat on battery parameter naming
// Older firmware: Single battery setup using BAT_* naming
@@ -413,7 +413,7 @@ SetupPage {
QGCPopupDialog {
title: qsTr("Calculate Voltage Divider")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
property alias batteryIndex: batParams.batteryIndex
@@ -471,7 +471,7 @@ SetupPage {
QGCPopupDialog {
title: qsTr("Calculate Amps per Volt")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
property alias batteryIndex: batParams.batteryIndex
@@ -530,7 +530,7 @@ SetupPage {
QGCPopupDialog {
id: escCalibrationDlg
title: qsTr("ESC Calibration")
- buttons: StandardButton.Ok
+ buttons: Dialog.Ok
acceptButtonEnabled: false
Connections {
diff --git a/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml b/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml
index f0674ce2e..90a87a6ef 100644
--- a/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml
+++ b/src/AutoPilotPlugins/PX4/PowerComponentSummary.qml
@@ -12,13 +12,13 @@
/// @brief Battery, propeller and magnetometer summary
/// @author Gus Grubba
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/PX4/SafetyComponent.qml b/src/AutoPilotPlugins/PX4/SafetyComponent.qml
index 7e04b5727..5cf223d06 100644
--- a/src/AutoPilotPlugins/PX4/SafetyComponent.qml
+++ b/src/AutoPilotPlugins/PX4/SafetyComponent.qml
@@ -8,18 +8,17 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
SetupPage {
id: safetyPage
@@ -172,7 +171,7 @@ SetupPage {
Layout.minimumWidth:_editFieldWidth
Layout.fillWidth: true
currentIndex: _collisionPrevention ? (_collisionPrevention.rawValue > 0 ? 1 : 0) : 0
- onActivated: {
+ onActivated: (index) => {
if(_collisionPrevention) {
_collisionPrevention.value = index > 0 ? 5 : -1
console.log('Collision prevention enabled: ' + _collisionPrevention.value)
@@ -210,11 +209,11 @@ SetupPage {
Layout.minimumHeight: ScreenTools.defaultFontPixelHeight * 2
Layout.fillWidth: true
Layout.fillHeight: true
- maximumValue: QGroundControl.unitsConversion.metersToAppSettingsHorizontalDistanceUnits(15)
- minimumValue: QGroundControl.unitsConversion.metersToAppSettingsHorizontalDistanceUnits(1)
+ to: QGroundControl.unitsConversion.metersToAppSettingsHorizontalDistanceUnits(15)
+ from: QGroundControl.unitsConversion.metersToAppSettingsHorizontalDistanceUnits(1)
stepSize: 1
displayValue: true
- updateValueWhileDragging: false
+ live: false
Layout.alignment: Qt.AlignVCenter
value: {
if (_collisionPrevention && _collisionPrevention.rawValue > 0) {
diff --git a/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml b/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml
index 77c5da77d..ac79fdb0a 100644
--- a/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml
+++ b/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
Item {
anchors.fill: parent
diff --git a/src/AutoPilotPlugins/PX4/SensorsComponent.qml b/src/AutoPilotPlugins/PX4/SensorsComponent.qml
index 6c3bf0693..7ab65f247 100644
--- a/src/AutoPilotPlugins/PX4/SensorsComponent.qml
+++ b/src/AutoPilotPlugins/PX4/SensorsComponent.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl.Controls 1.0
-import QGroundControl.PX4 1.0
+import QGroundControl.Controls
+import QGroundControl.PX4
SetupPage {
pageComponent: pageComponent
diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml
index c1a5aeb93..649ab70ad 100644
--- a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml
+++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml
@@ -1,11 +1,11 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
/*
IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml
diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml
index 50c0f8a92..f6d3ac3eb 100644
--- a/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml
+++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.Palette
/*
IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml
diff --git a/src/AutoPilotPlugins/PX4/SensorsSetup.qml b/src/AutoPilotPlugins/PX4/SensorsSetup.qml
index 4340bba68..981a4816f 100644
--- a/src/AutoPilotPlugins/PX4/SensorsSetup.qml
+++ b/src/AutoPilotPlugins/PX4/SensorsSetup.qml
@@ -7,19 +7,19 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.15
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
/// Page for sensor calibration. This control is used within the SensorsComponent control and can also be used
/// standalone for custom uis. When using standadalone you can use the various show* bools to show/hide what you want.
@@ -191,6 +191,8 @@ Item {
}
}
+ QGCPalette { id: qgcPal; colorGroupEnabled: true }
+
SensorsComponentController {
id: controller
statusLog: statusTextArea
@@ -250,7 +252,7 @@ Item {
id: preCalibrationDialogComponent
QGCPopupDialog {
- buttons: StandardButton.Cancel | StandardButton.Ok
+ buttons: Dialog.Cancel | Dialog.Ok
onAccepted: {
if (preCalibrationDialogType == "gyro") {
@@ -318,7 +320,7 @@ Item {
id: setOrientationsDialogComponent
QGCPopupDialog {
- buttons: StandardButton.Ok
+ buttons: Dialog.Ok
property bool showRebootVehicleButton: true
@@ -523,13 +525,9 @@ Item {
width: parent.calDisplayAreaWidth
height: parent.height
readOnly: true
- frameVisible: false
text: statusTextAreaDefaultText
-
- style: TextAreaStyle {
- textColor: qgcPal.text
- backgroundColor: qgcPal.windowShade
- }
+ color: qgcPal.Text
+ background: Rectangle { color: qgcPal.windowShade }
}
Rectangle {
diff --git a/src/Camera/QGCCameraIO.cc b/src/Camera/QGCCameraIO.cc
index 82b38975d..ca2bf8e02 100644
--- a/src/Camera/QGCCameraIO.cc
+++ b/src/Camera/QGCCameraIO.cc
@@ -174,7 +174,7 @@ QGCCameraParamIO::_sendParameter()
case FactMetaData::valueTypeCustom:
{
QByteArray custom = _fact->rawValue().toByteArray();
- memcpy(union_value.bytes, custom.data(), static_cast(std::max(custom.size(), MAVLINK_MSG_PARAM_EXT_SET_FIELD_PARAM_VALUE_LEN)));
+ memcpy(union_value.bytes, custom.data(), static_cast(std::max(custom.size(), static_cast(MAVLINK_MSG_PARAM_EXT_SET_FIELD_PARAM_VALUE_LEN))));
}
break;
default:
diff --git a/src/FactSystem/FactControls/AltitudeFactTextField.qml b/src/FactSystem/FactControls/AltitudeFactTextField.qml
index 52d6529cc..3f3371de0 100644
--- a/src/FactSystem/FactControls/AltitudeFactTextField.qml
+++ b/src/FactSystem/FactControls/AltitudeFactTextField.qml
@@ -6,14 +6,14 @@
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
FactTextField {
unitsLabel: fact ? fact.units : ""
diff --git a/src/FactSystem/FactControls/FactBitmask.qml b/src/FactSystem/FactControls/FactBitmask.qml
index 11f88416a..c01540fde 100644
--- a/src/FactSystem/FactControls/FactBitmask.qml
+++ b/src/FactSystem/FactControls/FactBitmask.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
Flow {
spacing: ScreenTools.defaultFontPixelWidth
diff --git a/src/FactSystem/FactControls/FactCheckBox.qml b/src/FactSystem/FactControls/FactCheckBox.qml
index 9f71bb4c8..96842961a 100644
--- a/src/FactSystem/FactControls/FactCheckBox.qml
+++ b/src/FactSystem/FactControls/FactCheckBox.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.FactSystem
+import QGroundControl.Palette
+import QGroundControl.Controls
QGCCheckBox {
property Fact fact: Fact { }
@@ -12,7 +12,7 @@ QGCCheckBox {
property variant checkedValue: 1
property variant uncheckedValue: 0
- Binding on checkedState {
+ Binding on checkState {
value: fact ?
(fact.typeIsBool ?
(fact.value === false ? Qt.Unchecked : Qt.Checked) :
diff --git a/src/FactSystem/FactControls/FactComboBox.qml b/src/FactSystem/FactControls/FactComboBox.qml
index 5b99f8a0f..d7b84aba7 100644
--- a/src/FactSystem/FactControls/FactComboBox.qml
+++ b/src/FactSystem/FactControls/FactComboBox.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.FactSystem
+import QGroundControl.Palette
+import QGroundControl.Controls
QGCComboBox {
property Fact fact: Fact { }
diff --git a/src/FactSystem/FactControls/FactLabel.qml b/src/FactSystem/FactControls/FactLabel.qml
index e44fef7e0..5e100d185 100644
--- a/src/FactSystem/FactControls/FactLabel.qml
+++ b/src/FactSystem/FactControls/FactLabel.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.FactSystem
+import QGroundControl.Palette
+import QGroundControl.Controls
QGCLabel {
property Fact fact: Fact { }
diff --git a/src/FactSystem/FactControls/FactTextField.qml b/src/FactSystem/FactControls/FactTextField.qml
index d22500bbe..33552d9cf 100644
--- a/src/FactSystem/FactControls/FactTextField.qml
+++ b/src/FactSystem/FactControls/FactTextField.qml
@@ -1,12 +1,12 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
QGCTextField {
id: _textField
diff --git a/src/FactSystem/FactControls/FactTextFieldGrid.qml b/src/FactSystem/FactControls/FactTextFieldGrid.qml
index 6c27cfa5f..b8d953c16 100644
--- a/src/FactSystem/FactControls/FactTextFieldGrid.qml
+++ b/src/FactSystem/FactControls/FactTextFieldGrid.qml
@@ -1,8 +1,8 @@
-import QtQuick 2.3
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.FactSystem
+import QGroundControl.Controls
GridLayout {
property var factList ///< List of Facts to show
diff --git a/src/FactSystem/FactControls/FactTextFieldRow.qml b/src/FactSystem/FactControls/FactTextFieldRow.qml
index 701e6bd52..9c2991ac3 100644
--- a/src/FactSystem/FactControls/FactTextFieldRow.qml
+++ b/src/FactSystem/FactControls/FactTextFieldRow.qml
@@ -1,8 +1,8 @@
-import QtQuick 2.3
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.FactSystem
+import QGroundControl.Controls
RowLayout {
property var fact: Fact { }
diff --git a/src/FactSystem/FactControls/FactTextFieldSlider.qml b/src/FactSystem/FactControls/FactTextFieldSlider.qml
index 9ea56ef5d..832528518 100644
--- a/src/FactSystem/FactControls/FactTextFieldSlider.qml
+++ b/src/FactSystem/FactControls/FactTextFieldSlider.qml
@@ -1,12 +1,12 @@
-import QtQuick 2.7
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl.FactSystem
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.FactControls
Row {
@@ -132,15 +132,15 @@ Row {
MouseArea {
anchors.fill: parent
- onWheel: {
+ onWheel: (wheel) => {
// do nothing
wheel.accepted = true;
}
- onPressed: {
+ onPressed: (mouse) => {
// propogate/accept
mouse.accepted = false;
}
- onReleased: {
+ onReleased: (mouse) => {
// propogate/accept
mouse.accepted = false;
}
diff --git a/src/FactSystem/FactControls/FactValueSlider.qml b/src/FactSystem/FactControls/FactValueSlider.qml
index c39e0b97b..b183ceff3 100644
--- a/src/FactSystem/FactControls/FactValueSlider.qml
+++ b/src/FactSystem/FactControls/FactValueSlider.qml
@@ -1,11 +1,11 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FactSystem
Rectangle {
height: _itemHeight
diff --git a/src/FactSystem/FactSystemTest.qml b/src/FactSystem/FactSystemTest.qml
index 240dbf300..29b7596b8 100644
--- a/src/FactSystem/FactSystemTest.qml
+++ b/src/FactSystem/FactSystemTest.qml
@@ -8,10 +8,10 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QtQuick
+import QtQuick.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
Item {
diff --git a/src/FactSystem/ParameterManager.cc b/src/FactSystem/ParameterManager.cc
index 543cb4ddf..cc92af16d 100644
--- a/src/FactSystem/ParameterManager.cc
+++ b/src/FactSystem/ParameterManager.cc
@@ -174,8 +174,9 @@ void ParameterManager::mavlinkMessageReceived(mavlink_message_t message)
mavlink_msg_param_value_decode(&message, ¶m_value);
// This will null terminate the name string
- QByteArray bytes(param_value.param_id, MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN);
- QString parameterName(bytes);
+ char parameterNameWithNull[MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN] = {};
+ strncpy(parameterNameWithNull, param_value.param_id, MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN);
+ QString parameterName(parameterNameWithNull);
mavlink_param_union_t paramUnion;
paramUnion.param_float = param_value.param_value;
@@ -1265,7 +1266,7 @@ QString ParameterManager::_remapParamNameToVersion(const QString& paramName)
qCDebug(ParameterManagerLog) << "_remapParamNameToVersion" << paramName << majorVersion << minorVersion;
- mappedParamName = paramName.right(paramName.count() - 2);
+ mappedParamName = paramName.right(paramName.length() - 2);
if (majorVersion == Vehicle::versionNotSetValue) {
// Vehicle version unknown
diff --git a/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc b/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
index 4e0fdefe1..f15f74a3c 100644
--- a/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
+++ b/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
@@ -29,10 +29,11 @@
#include "LinkManager.h"
#include
+#include
QGC_LOGGING_CATEGORY(APMFirmwarePluginLog, "APMFirmwarePluginLog")
-static const QRegExp APM_FRAME_REXP("^Frame: ");
+static const QRegularExpression APM_FRAME_REXP("^Frame: ");
const char* APMFirmwarePlugin::_artooIP = "10.1.1.1"; ///< IP address of ARTOO controller
const int APMFirmwarePlugin::_artooVideoHandshakePort = 5502; ///< Port for video handshake on ARTOO controller
@@ -1174,4 +1175,4 @@ void APMFirmwarePlugin::guidedModeChangeEquivalentAirspeedMetersSecond(Vehicle*
-1, // throttle, no change
0 // 0: absolute speed, 1: relative to current
); // param 5-7 unused
-}
\ No newline at end of file
+}
diff --git a/src/FirmwarePlugin/APM/APMParameterMetaData.cc b/src/FirmwarePlugin/APM/APMParameterMetaData.cc
index 4ad005546..65f572829 100644
--- a/src/FirmwarePlugin/APM/APMParameterMetaData.cc
+++ b/src/FirmwarePlugin/APM/APMParameterMetaData.cc
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
static const char* kInvalidConverstion = "Internal Error: No support for string parameters";
@@ -39,42 +40,42 @@ QVariant APMParameterMetaData::_stringToTypedVariant(const QString& string,
{
QVariant var(string);
- int convertTo = QVariant::Int; // keep compiler warning happy
+ QMetaType::Type convertTo = QMetaType::Int; // keep compiler warning happy
switch (type) {
case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeUint16:
case FactMetaData::valueTypeUint32:
case FactMetaData::valueTypeUint64:
- convertTo = QVariant::UInt;
+ convertTo = QMetaType::UInt;
break;
case FactMetaData::valueTypeInt8:
case FactMetaData::valueTypeInt16:
case FactMetaData::valueTypeInt32:
case FactMetaData::valueTypeInt64:
- convertTo = QVariant::Int;
+ convertTo = QMetaType::Int;
break;
case FactMetaData::valueTypeFloat:
convertTo = QMetaType::Float;
break;
case FactMetaData::valueTypeElapsedTimeInSeconds:
case FactMetaData::valueTypeDouble:
- convertTo = QVariant::Double;
+ convertTo = QMetaType::Double;
break;
case FactMetaData::valueTypeString:
qWarning() << kInvalidConverstion;
- convertTo = QVariant::String;
+ convertTo = QMetaType::QString;
break;
case FactMetaData::valueTypeBool:
qWarning() << kInvalidConverstion;
- convertTo = QVariant::Bool;
+ convertTo = QMetaType::Bool;
break;
case FactMetaData::valueTypeCustom:
qWarning() << kInvalidConverstion;
- convertTo = QVariant::ByteArray;
+ convertTo = QMetaType::QByteArray;
break;
}
- *convertOk = var.convert(convertTo);
+ *convertOk = var.convert(QMetaType(convertTo));
return var;
}
@@ -132,7 +133,7 @@ QString APMParameterMetaData::mavTypeToString(MAV_TYPE vehicleTypeEnum)
QString APMParameterMetaData::_groupFromParameterName(const QString& name)
{
QString group = name.split('_').first();
- return group.remove(QRegExp("[0-9]*$")); // remove any numbers from the end
+ return group.remove(QRegularExpression("[0-9]*$")); // remove any numbers from the end
}
@@ -143,7 +144,7 @@ void APMParameterMetaData::loadParameterFactMetaDataFile(const QString& metaData
}
_parameterMetaDataLoaded = true;
- QRegExp parameterCategories = QRegExp("ArduCopter|ArduPlane|APMrover2|Rover|ArduSub|AntennaTracker");
+ auto parameterCategories = QRegularExpression("ArduCopter|ArduPlane|APMrover2|Rover|ArduSub|AntennaTracker");
QString currentCategory;
qCDebug(APMParameterMetaDataLog) << "Loading parameter meta data:" << metaDataFile;
diff --git a/src/FirmwarePlugin/APM/APMSensorIdDecoder.qml b/src/FirmwarePlugin/APM/APMSensorIdDecoder.qml
index f40448585..1f716222c 100644
--- a/src/FirmwarePlugin/APM/APMSensorIdDecoder.qml
+++ b/src/FirmwarePlugin/APM/APMSensorIdDecoder.qml
@@ -10,14 +10,14 @@
// Based on https://github.com/ArduPilot/MAVProxy/blob/9bf8b00fbc355650b060e546110877c7898baa81/MAVProxy/modules/lib/mp_util.py#L384
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.FactSystem
+import QGroundControl.Palette
+import QGroundControl.Controls
QGCLabel {
property Fact fact: Fact { }
diff --git a/src/FirmwarePlugin/APM/APMSensorParams.qml b/src/FirmwarePlugin/APM/APMSensorParams.qml
index fb52e08ba..5e5182371 100644
--- a/src/FirmwarePlugin/APM/APMSensorParams.qml
+++ b/src/FirmwarePlugin/APM/APMSensorParams.qml
@@ -7,9 +7,9 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl.FactSystem 1.0
+import QGroundControl.FactSystem
/// This is used to handle the various differences between firmware versions and missing parameters in each in a standard way.
Item {
diff --git a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
index cf76d12af..a511e5e37 100644
--- a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
+++ b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
@@ -196,7 +196,7 @@ bool PX4FirmwarePlugin::setFlightMode(const QString& flightMode, uint8_t* base_m
bool found = false;
foreach (const FlightModeInfo_t& info, _flightModeInfoList) {
- if (flightMode.compare(info.name, Qt::CaseInsensitive) == 0) {
+ if (flightMode.compare(*info.name, Qt::CaseInsensitive) == 0) {
union px4_custom_mode px4_mode;
px4_mode.data = 0;
diff --git a/src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc b/src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc
index 0ce2badab..4fb7b59c7 100644
--- a/src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc
+++ b/src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc
@@ -38,42 +38,42 @@ QVariant PX4ParameterMetaData::_stringToTypedVariant(const QString& string, Fact
{
QVariant var(string);
- int convertTo = QVariant::Int; // keep compiler warning happy
+ QMetaType::Type convertTo = QMetaType::Int; // keep compiler warning happy
switch (type) {
case FactMetaData::valueTypeUint8:
case FactMetaData::valueTypeUint16:
case FactMetaData::valueTypeUint32:
case FactMetaData::valueTypeUint64:
- convertTo = QVariant::UInt;
+ convertTo = QMetaType::UInt;
break;
case FactMetaData::valueTypeInt8:
case FactMetaData::valueTypeInt16:
case FactMetaData::valueTypeInt32:
case FactMetaData::valueTypeInt64:
- convertTo = QVariant::Int;
+ convertTo = QMetaType::Int;
break;
case FactMetaData::valueTypeFloat:
convertTo = QMetaType::Float;
break;
case FactMetaData::valueTypeElapsedTimeInSeconds:
case FactMetaData::valueTypeDouble:
- convertTo = QVariant::Double;
+ convertTo = QMetaType::Double;
break;
case FactMetaData::valueTypeString:
qWarning() << kInvalidConverstion;
- convertTo = QVariant::String;
+ convertTo = QMetaType::QString;
break;
case FactMetaData::valueTypeBool:
qWarning() << kInvalidConverstion;
- convertTo = QVariant::Bool;
+ convertTo = QMetaType::Bool;
break;
case FactMetaData::valueTypeCustom:
qWarning() << kInvalidConverstion;
- convertTo = QVariant::ByteArray;
+ convertTo = QMetaType::QByteArray;
break;
}
- *convertOk = var.convert(convertTo);
+ *convertOk = var.convert(QMetaType(convertTo));
return var;
}
diff --git a/src/FirstRunPromptDialogs/FirstRunPrompt.qml b/src/FirstRunPromptDialogs/FirstRunPrompt.qml
index 3e2b19654..f1a35d06b 100644
--- a/src/FirstRunPromptDialogs/FirstRunPrompt.qml
+++ b/src/FirstRunPromptDialogs/FirstRunPrompt.qml
@@ -7,15 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Dialogs 1.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.Controls
// Base class for all first run prompt dialogs
QGCPopupDialog {
- buttons: StandardButton.Ok
+ buttons: Dialog.Ok
property int promptId
property bool markAsShownOnClose: true
diff --git a/src/FirstRunPromptDialogs/OfflineVehicleFirstRunPrompt.qml b/src/FirstRunPromptDialogs/OfflineVehicleFirstRunPrompt.qml
index 4da593a80..9beb4f208 100644
--- a/src/FirstRunPromptDialogs/OfflineVehicleFirstRunPrompt.qml
+++ b/src/FirstRunPromptDialogs/OfflineVehicleFirstRunPrompt.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.SettingsManager 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.SettingsManager
+import QGroundControl.Controls
FirstRunPrompt {
title: qsTr("Vehicle Information")
diff --git a/src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml b/src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml
index 65fd41922..0e3864182 100644
--- a/src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml
+++ b/src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.SettingsManager 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.SettingsManager
+import QGroundControl.Controls
FirstRunPrompt {
title: qsTr("Measurement Units")
diff --git a/src/FlightDisplay/DefaultChecklist.qml b/src/FlightDisplay/DefaultChecklist.qml
index 47ff95d15..24565e906 100644
--- a/src/FlightDisplay/DefaultChecklist.qml
+++ b/src/FlightDisplay/DefaultChecklist.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQml.Models 2.1
+import QtQuick
+import QtQuick.Controls
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
+import QGroundControl.Vehicle
Item {
property var model: listModel
diff --git a/src/FlightDisplay/FixedWingChecklist.qml b/src/FlightDisplay/FixedWingChecklist.qml
index 895df23cf..4dc59a53b 100644
--- a/src/FlightDisplay/FixedWingChecklist.qml
+++ b/src/FlightDisplay/FixedWingChecklist.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQml.Models 2.1
+import QtQuick
+import QtQuick.Controls
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
+import QGroundControl.Vehicle
Item {
property var model: listModel
diff --git a/src/FlightDisplay/FlightDisplayViewDummy.qml b/src/FlightDisplay/FlightDisplayViewDummy.qml
index 62a8f5b2e..539da26d8 100644
--- a/src/FlightDisplay/FlightDisplayViewDummy.qml
+++ b/src/FlightDisplay/FlightDisplayViewDummy.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
Rectangle {
anchors.fill: parent
diff --git a/src/FlightDisplay/FlightDisplayViewUVC.qml b/src/FlightDisplay/FlightDisplayViewUVC.qml
index dbe2dcea5..5c2ab12a1 100644
--- a/src/FlightDisplay/FlightDisplayViewUVC.qml
+++ b/src/FlightDisplay/FlightDisplayViewUVC.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtMultimedia 5.5
+import QtQuick
+import QtMultimedia
-import QGroundControl 1.0
+import QGroundControl
Rectangle {
id: _root
diff --git a/src/FlightDisplay/FlightDisplayViewVideo.qml b/src/FlightDisplay/FlightDisplayViewVideo.qml
index 05913d3fc..56ea83609 100644
--- a/src/FlightDisplay/FlightDisplayViewVideo.qml
+++ b/src/FlightDisplay/FlightDisplayViewVideo.qml
@@ -8,17 +8,17 @@
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.FlightDisplay
+import QGroundControl.FlightMap
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Vehicle
+import QGroundControl.Controllers
Item {
id: root
diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml
index f0174e409..8b208e33b 100644
--- a/src/FlightDisplay/FlightDisplayViewWidgets.qml
+++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml
@@ -7,20 +7,20 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtLocation
+import QtPositioning
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Vehicle
+import QGroundControl.FlightMap
Loader {
width: parent.width
diff --git a/src/FlightDisplay/FlyView.qml b/src/FlightDisplay/FlyView.qml
index 68c2a8b2a..7a879cbab 100644
--- a/src/FlightDisplay/FlyView.qml
+++ b/src/FlightDisplay/FlyView.qml
@@ -7,25 +7,25 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Window 2.2
-import QtQml.Models 2.1
+import QtLocation
+import QtPositioning
+import QtQuick.Window
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controllers
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FlightDisplay
+import QGroundControl.FlightMap
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
Item {
id: _root
diff --git a/src/FlightDisplay/FlyViewCustomLayer.qml b/src/FlightDisplay/FlyViewCustomLayer.qml
index c09b7e4f8..6bc619eb4 100644
--- a/src/FlightDisplay/FlyViewCustomLayer.qml
+++ b/src/FlightDisplay/FlyViewCustomLayer.qml
@@ -7,25 +7,25 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Window 2.2
-import QtQml.Models 2.1
+import QtLocation
+import QtPositioning
+import QtQuick.Window
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controllers
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FlightDisplay
+import QGroundControl.FlightMap
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
// To implement a custom overlay copy this code to your own control in your custom code source. Then override the
// FlyViewCustomLayer.qml resource with your own qml. See the custom example and documentation for details.
diff --git a/src/FlightDisplay/FlyViewInsetViewer.qml b/src/FlightDisplay/FlyViewInsetViewer.qml
index 2f95208ff..176df1703 100644
--- a/src/FlightDisplay/FlyViewInsetViewer.qml
+++ b/src/FlightDisplay/FlyViewInsetViewer.qml
@@ -7,22 +7,22 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Window 2.2
-import QtQml.Models 2.1
+import QtLocation
+import QtPositioning
+import QtQuick.Window
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.FlightDisplay
+import QGroundControl.ScreenTools
+import QGroundControl.FlightMap
// This is the ui overlay layer for the widgets/tools for Fly View
diff --git a/src/FlightDisplay/FlyViewInstrumentPanel.qml b/src/FlightDisplay/FlyViewInstrumentPanel.qml
index 32ab45e05..451caffad 100644
--- a/src/FlightDisplay/FlyViewInstrumentPanel.qml
+++ b/src/FlightDisplay/FlyViewInstrumentPanel.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.12
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
// This control contains the instruments as well and the instrument pages which include values, camera, ...
Column {
diff --git a/src/FlightDisplay/FlyViewMap.qml b/src/FlightDisplay/FlyViewMap.qml
index 139687484..c53e9d3bd 100644
--- a/src/FlightDisplay/FlyViewMap.qml
+++ b/src/FlightDisplay/FlyViewMap.qml
@@ -7,21 +7,21 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controllers
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
+import QGroundControl.FlightMap
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
FlightMap {
id: _root
@@ -80,22 +80,16 @@ FlightMap {
onZoomLevelChanged: {
if (_saveZoomLevelSetting) {
- QGroundControl.flightMapZoom = zoomLevel
+ QGroundControl.flightMapZoom = _root.zoomLevel
}
}
onCenterChanged: {
- QGroundControl.flightMapPosition = center
+ QGroundControl.flightMapPosition = _root.center
}
// We track whether the user has panned or not to correctly handle automatic map positioning
- Connections {
- target: gesture
-
- function onPanStarted() { _disableVehicleTracking = true }
- function onFlickStarted() { _disableVehicleTracking = true }
- function onPanFinished() { panRecenterTimer.restart() }
- function onFlickFinished() { panRecenterTimer.restart() }
- }
+ onMapPanStart: _disableVehicleTracking = true
+ onMapPanStop: panRecenterTimer.restart()
function pointInRect(point, rect) {
return point.x > rect.x &&
@@ -269,10 +263,10 @@ FlightMap {
}
Connections {
- target: _activeVehicle ? _activeVehicle.trajectoryPoints : null
- onPointAdded: trajectoryPolyline.addCoordinate(coordinate)
- onUpdateLastPoint: trajectoryPolyline.replaceCoordinate(trajectoryPolyline.pathLength() - 1, coordinate)
- onPointsCleared: trajectoryPolyline.path = []
+ target: _activeVehicle ? _activeVehicle.trajectoryPoints : null
+ onPointAdded: (coordinate) => trajectoryPolyline.addCoordinate(coordinate)
+ onUpdateLastPoint: (coordinate) => trajectoryPolyline.replaceCoordinate(trajectoryPolyline.pathLength() - 1, coordinate)
+ onPointsCleared: trajectoryPolyline.path = []
}
}
@@ -628,7 +622,7 @@ FlightMap {
}
}
- onClicked: {
+ onClicked: (mouse) => {
if (!globals.guidedControllerFlyView.guidedUIVisible && (globals.guidedControllerFlyView.showGotoLocation || globals.guidedControllerFlyView.showOrbit || globals.guidedControllerFlyView.showROI || globals.guidedControllerFlyView.showSetHome)) {
orbitMapCircle.hide()
gotoLocationItem.hide()
diff --git a/src/FlightDisplay/FlyViewMissionCompleteDialog.qml b/src/FlightDisplay/FlyViewMissionCompleteDialog.qml
index 8b490c725..3086cbed3 100644
--- a/src/FlightDisplay/FlyViewMissionCompleteDialog.qml
+++ b/src/FlightDisplay/FlyViewMissionCompleteDialog.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
/// Dialog which shows up when a flight completes. Prompts the user for things like whether they should remove the plan from the vehicle.
Item {
@@ -60,7 +60,7 @@ Item {
QGCPopupDialog {
id: missionCompleteDialog
title: qsTr("Flight Plan complete")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
property var activeVehicleCopy: _activeVehicle
onActiveVehicleCopyChanged:
diff --git a/src/FlightDisplay/FlyViewPreFlightChecklistPopup.qml b/src/FlightDisplay/FlyViewPreFlightChecklistPopup.qml
index eeff2d416..6df772652 100644
--- a/src/FlightDisplay/FlyViewPreFlightChecklistPopup.qml
+++ b/src/FlightDisplay/FlyViewPreFlightChecklistPopup.qml
@@ -7,19 +7,19 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.Vehicle
+import QGroundControl.Controls
/// Popup container for preflight checklists
QGCPopupDialog {
id: _root
title: qsTr("Pre-Flight Checklist")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
diff --git a/src/FlightDisplay/FlyViewToolStrip.qml b/src/FlightDisplay/FlyViewToolStrip.qml
index 8f543bdad..8f2bdb9ca 100644
--- a/src/FlightDisplay/FlyViewToolStrip.qml
+++ b/src/FlightDisplay/FlyViewToolStrip.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQml.Models 2.12
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
ToolStrip {
id: _root
diff --git a/src/FlightDisplay/FlyViewToolStripActionList.qml b/src/FlightDisplay/FlyViewToolStripActionList.qml
index 331aaea28..01fb75f10 100644
--- a/src/FlightDisplay/FlyViewToolStripActionList.qml
+++ b/src/FlightDisplay/FlyViewToolStripActionList.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQml.Models 2.12
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.Controls
ToolStripActionList {
id: _root
diff --git a/src/FlightDisplay/FlyViewVideo.qml b/src/FlightDisplay/FlyViewVideo.qml
index 109e69e9c..058041f8a 100644
--- a/src/FlightDisplay/FlyViewVideo.qml
+++ b/src/FlightDisplay/FlyViewVideo.qml
@@ -7,12 +7,12 @@
*
****************************************************************************/
-import QtQuick 2.12
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
Item {
id: _root
diff --git a/src/FlightDisplay/FlyViewWidgetLayer.qml b/src/FlightDisplay/FlyViewWidgetLayer.qml
index 8f4fbea72..013ccfba3 100644
--- a/src/FlightDisplay/FlyViewWidgetLayer.qml
+++ b/src/FlightDisplay/FlyViewWidgetLayer.qml
@@ -7,26 +7,26 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Window 2.2
-import QtQml.Models 2.1
+import QtLocation
+import QtPositioning
+import QtQuick.Window
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FlightDisplay
+import QGroundControl.FlightMap
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
// This is the ui overlay layer for the widgets/tools for Fly View
Item {
diff --git a/src/FlightDisplay/GripperMenu.qml b/src/FlightDisplay/GripperMenu.qml
index b1c863e76..812389aef 100644
--- a/src/FlightDisplay/GripperMenu.qml
+++ b/src/FlightDisplay/GripperMenu.qml
@@ -1,70 +1,67 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtLocation
+import QtPositioning
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Vehicle
+import QGroundControl.FlightMap
-Component {
- id: messageDialogComponent
- QGCPopupDialog {
- title: "Select one action"
- property var acceptFunction: null
- buttons: StandardButton.Cancel
+QGCPopupDialog {
+ title: "Select one action"
+ property var acceptFunction: null
+ buttons: Dialog.Cancel
- onRejected:{
+ onRejected:{
+ _guidedController._gripperFunction = Vehicle.Invalid_option
+ _guidedController.closeAll()
+ close()
+ }
+
+ onAccepted: {
+ if (acceptFunction) {
_guidedController._gripperFunction = Vehicle.Invalid_option
- _guidedController.closeAll()
close()
}
+ }
- onAccepted: {
- if (acceptFunction) {
- _guidedController._gripperFunction = Vehicle.Invalid_option
+ RowLayout {
+ QGCColumnButton {
+ id: grabButton
+ text: "Grab"
+ iconSource: "/res/GripperGrab.svg"
+ pointSize: ScreenTools.defaultFontPointSize * 3.5
+ backRadius: width / 40
+ heightFactor: 0.75
+ Layout.preferredHeight: releaseButton.height
+ Layout.preferredWidth: releaseButton.width
+
+ onClicked: {
+ _guidedController._gripperFunction = Vehicle.Gripper_grab
close()
}
}
- RowLayout {
- QGCColumnButton {
- id: grabButton
- text: "Grab"
- iconSource: "/res/GripperGrab.svg"
- pointSize: ScreenTools.defaultFontPointSize * 3.5
- backRadius: width / 40
- heightFactor: 0.75
- Layout.preferredHeight: releaseButton.height
- Layout.preferredWidth: releaseButton.width
+ QGCColumnButton {
+ id: releaseButton
+ text: "Release"
+ iconSource: "/res/GripperRelease.svg"
+ pointSize: ScreenTools.defaultFontPointSize * 3.5
+ backRadius: width / 40
+ heightFactor: 0.75
+ Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 27
+ Layout.preferredHeight: Layout.preferredWidth / 1.20
- onClicked: {
- _guidedController._gripperFunction = Vehicle.Gripper_grab
- close()
- }
- }
-
- QGCColumnButton {
- id: releaseButton
- text: "Release"
- iconSource: "/res/GripperRelease.svg"
- pointSize: ScreenTools.defaultFontPointSize * 3.5
- backRadius: width / 40
- heightFactor: 0.75
- Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 27
- Layout.preferredHeight: Layout.preferredWidth / 1.20
-
- onClicked: {
- _guidedController._gripperFunction = Vehicle.Gripper_release
- close()
- }
+ onClicked: {
+ _guidedController._gripperFunction = Vehicle.Gripper_release
+ close()
}
}
}
diff --git a/src/FlightDisplay/GuidedActionActionList.qml b/src/FlightDisplay/GuidedActionActionList.qml
index c88a9f1b4..ca4fa458e 100644
--- a/src/FlightDisplay/GuidedActionActionList.qml
+++ b/src/FlightDisplay/GuidedActionActionList.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QGroundControl.FlightDisplay 1.0
+import QGroundControl.FlightDisplay
GuidedToolStripAction {
text: _guidedController.actionListTitle
diff --git a/src/FlightDisplay/GuidedActionConfirm.qml b/src/FlightDisplay/GuidedActionConfirm.qml
index b01dce3b7..6441b36fe 100644
--- a/src/FlightDisplay/GuidedActionConfirm.qml
+++ b/src/FlightDisplay/GuidedActionConfirm.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
Rectangle {
id: _root
diff --git a/src/FlightDisplay/GuidedActionGripper.qml b/src/FlightDisplay/GuidedActionGripper.qml
index cddb3c49f..71960d4fe 100644
--- a/src/FlightDisplay/GuidedActionGripper.qml
+++ b/src/FlightDisplay/GuidedActionGripper.qml
@@ -7,8 +7,8 @@
*
****************************************************************************/
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl 1.0
+import QGroundControl.FlightDisplay
+import QGroundControl
GuidedToolStripAction {
property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
diff --git a/src/FlightDisplay/GuidedActionLand.qml b/src/FlightDisplay/GuidedActionLand.qml
index d4a539a4f..811b0fc45 100644
--- a/src/FlightDisplay/GuidedActionLand.qml
+++ b/src/FlightDisplay/GuidedActionLand.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QGroundControl.FlightDisplay 1.0
+import QGroundControl.FlightDisplay
GuidedToolStripAction {
text: _guidedController.landTitle
diff --git a/src/FlightDisplay/GuidedActionList.qml b/src/FlightDisplay/GuidedActionList.qml
index 6b494d7e0..ce9e9e30c 100644
--- a/src/FlightDisplay/GuidedActionList.qml
+++ b/src/FlightDisplay/GuidedActionList.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.FlightDisplay
+import QGroundControl.Palette
/// Dialog showing list of available guided actions
Rectangle {
diff --git a/src/FlightDisplay/GuidedActionPause.qml b/src/FlightDisplay/GuidedActionPause.qml
index 7fa33654c..e62a82b3f 100644
--- a/src/FlightDisplay/GuidedActionPause.qml
+++ b/src/FlightDisplay/GuidedActionPause.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QGroundControl.FlightDisplay 1.0
+import QGroundControl.FlightDisplay
GuidedToolStripAction {
text: _guidedController.pauseTitle
diff --git a/src/FlightDisplay/GuidedActionRTL.qml b/src/FlightDisplay/GuidedActionRTL.qml
index 288b917cf..21c442aa6 100644
--- a/src/FlightDisplay/GuidedActionRTL.qml
+++ b/src/FlightDisplay/GuidedActionRTL.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QGroundControl.FlightDisplay 1.0
+import QGroundControl.FlightDisplay
GuidedToolStripAction {
text: _guidedController.rtlTitle
diff --git a/src/FlightDisplay/GuidedActionTakeoff.qml b/src/FlightDisplay/GuidedActionTakeoff.qml
index 32670b64e..78e6a0cc5 100644
--- a/src/FlightDisplay/GuidedActionTakeoff.qml
+++ b/src/FlightDisplay/GuidedActionTakeoff.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QGroundControl.FlightDisplay 1.0
+import QGroundControl.FlightDisplay
GuidedToolStripAction {
text: _guidedController.takeoffTitle
diff --git a/src/FlightDisplay/GuidedActionsController.qml b/src/FlightDisplay/GuidedActionsController.qml
index 26985353c..2b935d527 100644
--- a/src/FlightDisplay/GuidedActionsController.qml
+++ b/src/FlightDisplay/GuidedActionsController.qml
@@ -7,20 +7,20 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtLocation
+import QtPositioning
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Vehicle
+import QGroundControl.FlightMap
/// This provides the smarts behind the guided mode commands, minus the user interface. This way you can change UI
/// without affecting the underlying functionality.
diff --git a/src/FlightDisplay/GuidedToolStripAction.qml b/src/FlightDisplay/GuidedToolStripAction.qml
index 9cf2a28b7..b29ed2db4 100644
--- a/src/FlightDisplay/GuidedToolStripAction.qml
+++ b/src/FlightDisplay/GuidedToolStripAction.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QGroundControl.Controls 1.0
+import QGroundControl.Controls
ToolStripAction {
property int actionID
diff --git a/src/FlightDisplay/GuidedValueSlider.qml b/src/FlightDisplay/GuidedValueSlider.qml
index a7487c613..357679ea8 100644
--- a/src/FlightDisplay/GuidedValueSlider.qml
+++ b/src/FlightDisplay/GuidedValueSlider.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Vehicle
+import QGroundControl.Palette
Rectangle {
id: _root
@@ -164,8 +164,8 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
orientation: Qt.Vertical
- minimumValue: -1
- maximumValue: 1
+ from: -1
+ to: 1
zeroCentered: false
rotation: 180
diff --git a/src/FlightDisplay/MultiRotorChecklist.qml b/src/FlightDisplay/MultiRotorChecklist.qml
index 6968e53c9..eb9893706 100644
--- a/src/FlightDisplay/MultiRotorChecklist.qml
+++ b/src/FlightDisplay/MultiRotorChecklist.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQml.Models 2.1
+import QtQuick
+import QtQuick.Controls
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
+import QGroundControl.Vehicle
Item {
property var model: listModel
diff --git a/src/FlightDisplay/MultiVehicleList.qml b/src/FlightDisplay/MultiVehicleList.qml
index 2ab5a1ecb..73b2e56f7 100644
--- a/src/FlightDisplay/MultiVehicleList.qml
+++ b/src/FlightDisplay/MultiVehicleList.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Vehicle
+import QGroundControl.FlightMap
Item {
property real _margin: ScreenTools.defaultFontPixelWidth / 2
diff --git a/src/FlightDisplay/ObstacleDistanceOverlay.qml b/src/FlightDisplay/ObstacleDistanceOverlay.qml
index 64dda7ac2..a4262a448 100644
--- a/src/FlightDisplay/ObstacleDistanceOverlay.qml
+++ b/src/FlightDisplay/ObstacleDistanceOverlay.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQuick 2.11
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.SettingsManager 1.0
+import QGroundControl
+import QGroundControl.SettingsManager
Canvas {
id: canvas
diff --git a/src/FlightDisplay/ObstacleDistanceOverlayMap.qml b/src/FlightDisplay/ObstacleDistanceOverlayMap.qml
index b9a16fc1f..7a2d7f5c9 100644
--- a/src/FlightDisplay/ObstacleDistanceOverlayMap.qml
+++ b/src/FlightDisplay/ObstacleDistanceOverlayMap.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQuick 2.11
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.SettingsManager 1.0
+import QGroundControl
+import QGroundControl.SettingsManager
Item {
id: root
diff --git a/src/FlightDisplay/ObstacleDistanceOverlayVideo.qml b/src/FlightDisplay/ObstacleDistanceOverlayVideo.qml
index 2d51c1e79..64ebcffd5 100644
--- a/src/FlightDisplay/ObstacleDistanceOverlayVideo.qml
+++ b/src/FlightDisplay/ObstacleDistanceOverlayVideo.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQuick 2.11
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.SettingsManager 1.0
+import QGroundControl
+import QGroundControl.SettingsManager
Item {
id: root
diff --git a/src/FlightDisplay/PreFlightBatteryCheck.qml b/src/FlightDisplay/PreFlightBatteryCheck.qml
index ecae8d692..2ccba02ee 100644
--- a/src/FlightDisplay/PreFlightBatteryCheck.qml
+++ b/src/FlightDisplay/PreFlightBatteryCheck.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Vehicle
// This class stores the data and functions of the check list but NOT the GUI (which is handled somewhere else).
PreFlightCheckButton {
diff --git a/src/FlightDisplay/PreFlightCheckList.qml b/src/FlightDisplay/PreFlightCheckList.qml
index 3be959a1f..3c8baa42c 100644
--- a/src/FlightDisplay/PreFlightCheckList.qml
+++ b/src/FlightDisplay/PreFlightCheckList.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQml.Models 2.1
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Controls
+import QtQml.Models
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
+import QGroundControl.Vehicle
ColumnLayout {
spacing: 0.8 * ScreenTools.defaultFontPixelWidth
diff --git a/src/FlightDisplay/PreFlightCheckListShowAction.qml b/src/FlightDisplay/PreFlightCheckListShowAction.qml
index 8626a06fe..6a10b1132 100644
--- a/src/FlightDisplay/PreFlightCheckListShowAction.qml
+++ b/src/FlightDisplay/PreFlightCheckListShowAction.qml
@@ -7,8 +7,8 @@
*
****************************************************************************/
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.Controls
ToolStripAction {
text: qsTr("Checklist")
diff --git a/src/FlightDisplay/PreFlightGPSCheck.qml b/src/FlightDisplay/PreFlightGPSCheck.qml
index b1499a64c..d39854474 100644
--- a/src/FlightDisplay/PreFlightGPSCheck.qml
+++ b/src/FlightDisplay/PreFlightGPSCheck.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Vehicle
PreFlightCheckButton {
name: qsTr("GPS")
diff --git a/src/FlightDisplay/PreFlightRCCheck.qml b/src/FlightDisplay/PreFlightRCCheck.qml
index cf57aa915..196ea5f48 100644
--- a/src/FlightDisplay/PreFlightRCCheck.qml
+++ b/src/FlightDisplay/PreFlightRCCheck.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Vehicle
PreFlightCheckButton {
name: qsTr("Radio Control")
diff --git a/src/FlightDisplay/PreFlightSensorsHealthCheck.qml b/src/FlightDisplay/PreFlightSensorsHealthCheck.qml
index ba50b8852..4a860b330 100644
--- a/src/FlightDisplay/PreFlightSensorsHealthCheck.qml
+++ b/src/FlightDisplay/PreFlightSensorsHealthCheck.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Vehicle
PreFlightCheckButton {
name: qsTr("Sensors")
diff --git a/src/FlightDisplay/PreFlightSoundCheck.qml b/src/FlightDisplay/PreFlightSoundCheck.qml
index 6b585403e..1714a12d7 100644
--- a/src/FlightDisplay/PreFlightSoundCheck.qml
+++ b/src/FlightDisplay/PreFlightSoundCheck.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.Controls
PreFlightCheckButton {
name: qsTr("Sound output")
diff --git a/src/FlightDisplay/ProximityRadarValues.qml b/src/FlightDisplay/ProximityRadarValues.qml
index 226f5a2c4..20e912b87 100644
--- a/src/FlightDisplay/ProximityRadarValues.qml
+++ b/src/FlightDisplay/ProximityRadarValues.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QtQuick 2.12
+import QtQuick
/// Object which exposes vehicle distanceSensors FactGroup information for use in UI
QtObject {
diff --git a/src/FlightDisplay/ProximityRadarVideoView.qml b/src/FlightDisplay/ProximityRadarVideoView.qml
index 84d03119d..de1a75ef7 100644
--- a/src/FlightDisplay/ProximityRadarVideoView.qml
+++ b/src/FlightDisplay/ProximityRadarVideoView.qml
@@ -7,16 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
Item {
id: _root
diff --git a/src/FlightDisplay/RoverChecklist.qml b/src/FlightDisplay/RoverChecklist.qml
index a17fbc4f9..d6df16219 100644
--- a/src/FlightDisplay/RoverChecklist.qml
+++ b/src/FlightDisplay/RoverChecklist.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQml.Models 2.1
+import QtQuick
+import QtQuick.Controls
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
+import QGroundControl.Vehicle
Item {
property var model: listModel
diff --git a/src/FlightDisplay/SubChecklist.qml b/src/FlightDisplay/SubChecklist.qml
index b777baf27..0e8965d4e 100644
--- a/src/FlightDisplay/SubChecklist.qml
+++ b/src/FlightDisplay/SubChecklist.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQml.Models 2.1
+import QtQuick
+import QtQuick.Controls
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
+import QGroundControl.Vehicle
Item {
property var model: listModel
diff --git a/src/FlightDisplay/TelemetryValuesBar.qml b/src/FlightDisplay/TelemetryValuesBar.qml
index 136cfe175..c54b0571b 100644
--- a/src/FlightDisplay/TelemetryValuesBar.qml
+++ b/src/FlightDisplay/TelemetryValuesBar.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.Palette
Rectangle {
id: telemetryPanel
@@ -86,29 +86,29 @@ Rectangle {
}
}
- QGCMouseArea {
- id: mouseArea
- x: telemetryLayout.x
- y: telemetryLayout.y
- width: telemetryLayout.width
- height: telemetryLayout.height
- hoverEnabled: !ScreenTools.isMobile
- propagateComposedEvents: true
-
- onClicked: {
- if (ScreenTools.isMobile && !valueArea.settingsUnlocked) {
- valueArea.settingsUnlocked = true
- mouse.accepted = true
- } else {
- mouse.accepted = false
- }
- }
- }
-
HorizontalFactValueGrid {
id: valueArea
userSettingsGroup: telemetryBarUserSettingsGroup
defaultSettingsGroup: telemetryBarDefaultSettingsGroup
}
}
+
+ QGCMouseArea {
+ id: mouseArea
+ x: telemetryLayout.x
+ y: telemetryLayout.y
+ width: telemetryLayout.width
+ height: telemetryLayout.height
+ hoverEnabled: !ScreenTools.isMobile
+ propagateComposedEvents: true
+
+ onClicked: (mouse) => {
+ if (ScreenTools.isMobile && !valueArea.settingsUnlocked) {
+ valueArea.settingsUnlocked = true
+ mouse.accepted = true
+ } else {
+ mouse.accepted = false
+ }
+ }
+ }
}
diff --git a/src/FlightDisplay/TerrainProgress.qml b/src/FlightDisplay/TerrainProgress.qml
index 23d840e8e..764ece804 100644
--- a/src/FlightDisplay/TerrainProgress.qml
+++ b/src/FlightDisplay/TerrainProgress.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.Palette
Rectangle {
height: mainLayout.height + (_margins * 2)
diff --git a/src/FlightDisplay/VTOLChecklist.qml b/src/FlightDisplay/VTOLChecklist.qml
index f0235e399..dc8306194 100644
--- a/src/FlightDisplay/VTOLChecklist.qml
+++ b/src/FlightDisplay/VTOLChecklist.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQml.Models 2.1
+import QtQuick
+import QtQuick.Controls
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
+import QGroundControl.Vehicle
Item {
property var model: listModel
diff --git a/src/FlightDisplay/VehicleWarnings.qml b/src/FlightDisplay/VehicleWarnings.qml
index 44259a1e4..595822e32 100644
--- a/src/FlightDisplay/VehicleWarnings.qml
+++ b/src/FlightDisplay/VehicleWarnings.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
Rectangle {
anchors.margins: -ScreenTools.defaultFontPixelHeight
diff --git a/src/FlightDisplay/VirtualJoystick.qml b/src/FlightDisplay/VirtualJoystick.qml
index 64abea871..f644e84fe 100644
--- a/src/FlightDisplay/VirtualJoystick.qml
+++ b/src/FlightDisplay/VirtualJoystick.qml
@@ -8,13 +8,13 @@
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Vehicle
Item {
// The following properties must be passed in from the Loader
diff --git a/src/FlightMap/FlightMap.qml b/src/FlightMap/FlightMap.qml
index 7aefc1103..a64b0cd67 100644
--- a/src/FlightMap/FlightMap.qml
+++ b/src/FlightMap/FlightMap.qml
@@ -7,31 +7,26 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.QGCPositionManager 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.Controls
+import QGroundControl.FlightMap
+import QGroundControl.ScreenTools
+import QGroundControl.MultiVehicleManager
+import QGroundControl.Vehicle
+import QGroundControl.QGCPositionManager
Map {
id: _map
- //-- Qt 5.9 has rotation gesture enabled by default. Here we limit the possible gestures.
- gesture.acceptedGestures: MapGestureArea.PinchGesture | MapGestureArea.PanGesture | MapGestureArea.FlickGesture
- gesture.flickDeceleration: 3000
- plugin: Plugin { name: "QGroundControl" }
-
- // https://bugreports.qt.io/browse/QTBUG-82185
- opacity: 0.99
+ plugin: Plugin { name: "QGroundControl" }
+ opacity: 0.99 // https://bugreports.qt.io/browse/QTBUG-82185
property string mapName: 'defaultMap'
property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1
@@ -120,6 +115,37 @@ Map {
function onRawValueChanged() { updateActiveMapType() }
}
+ // We track whether the user has panned or not to correctly handle automatic map positioning
+ signal mapPanStart
+ signal mapPanStop
+ DragHandler {
+ target: null
+
+ onTranslationChanged: (delta) => _map.pan(-delta.x, -delta.y)
+
+ onGrabChanged: function(transition) {
+ switch (transition) {
+ case PointerDevice.GrabExclusive:
+ mapPanStart()
+ break
+ case PointerDevice.UngrabExclusive:
+ mapPanStop()
+ break
+ }
+ }
+ }
+
+ WheelHandler {
+ // workaround for QTBUG-87646 / QTBUG-112394 / QTBUG-112432:
+ // Magic Mouse pretends to be a trackpad but doesn't work with PinchHandler
+ // and we don't yet distinguish mice and trackpads on Wayland either
+ acceptedDevices: Qt.platform.pluginName === "cocoa" || Qt.platform.pluginName === "wayland"
+ ? PointerDevice.Mouse | PointerDevice.TouchPad
+ : PointerDevice.Mouse
+ rotationScale: 1/120
+ property: "zoomLevel"
+ }
+
/// Ground Station location
MapQuickItem {
anchorPoint.x: sourceItem.width / 2
diff --git a/src/FlightMap/MapItems/CameraTriggerIndicator.qml b/src/FlightMap/MapItems/CameraTriggerIndicator.qml
index f7566b2b4..01db413de 100644
--- a/src/FlightMap/MapItems/CameraTriggerIndicator.qml
+++ b/src/FlightMap/MapItems/CameraTriggerIndicator.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtLocation 5.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtLocation
+import QtQuick.Controls
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Vehicle
/// Marker for displaying a camera trigger on the map
MapQuickItem {
diff --git a/src/FlightMap/MapItems/CustomMapItems.qml b/src/FlightMap/MapItems/CustomMapItems.qml
index 0cc963df7..772cd3400 100644
--- a/src/FlightMap/MapItems/CustomMapItems.qml
+++ b/src/FlightMap/MapItems/CustomMapItems.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FlightMap
+import QGroundControl.Vehicle
// Allow custom builds to add visual items associated with the Flight Plan to the map
Item {
diff --git a/src/FlightMap/MapItems/MissionItemIndicator.qml b/src/FlightMap/MapItems/MissionItemIndicator.qml
index ac494f767..1d646f216 100644
--- a/src/FlightMap/MapItems/MissionItemIndicator.qml
+++ b/src/FlightMap/MapItems/MissionItemIndicator.qml
@@ -8,12 +8,12 @@
****************************************************************************/
-import QtQuick 2.3
-import QtLocation 5.3
+import QtQuick
+import QtLocation
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Vehicle
/// Marker for displaying a mission item on the map
MapQuickItem {
diff --git a/src/FlightMap/MapItems/MissionItemIndicatorDrag.qml b/src/FlightMap/MapItems/MissionItemIndicatorDrag.qml
index 8bac02aa7..42a84fff6 100644
--- a/src/FlightMap/MapItems/MissionItemIndicatorDrag.qml
+++ b/src/FlightMap/MapItems/MissionItemIndicatorDrag.qml
@@ -7,12 +7,12 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtLocation 5.3
+import QtQuick
+import QtLocation
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
/// Use to drag a MissionItemIndicator
Rectangle {
diff --git a/src/FlightMap/MapItems/MissionItemView.qml b/src/FlightMap/MapItems/MissionItemView.qml
index 685ac03e1..144fd4aa1 100644
--- a/src/FlightMap/MapItems/MissionItemView.qml
+++ b/src/FlightMap/MapItems/MissionItemView.qml
@@ -8,15 +8,15 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.FlightMap
+import QGroundControl.Controls
/// The MissionItemView control is used to add Mission Item Indicators to a FlightMap.
MapItemView {
diff --git a/src/FlightMap/MapItems/MissionLineView.qml b/src/FlightMap/MapItems/MissionLineView.qml
index e58db3598..ac8c01633 100644
--- a/src/FlightMap/MapItems/MissionLineView.qml
+++ b/src/FlightMap/MapItems/MissionLineView.qml
@@ -7,12 +7,12 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Palette
/// The MissionLineView control is used to add lines between mission items
MapItemView {
diff --git a/src/FlightMap/MapItems/PlanMapItems.qml b/src/FlightMap/MapItems/PlanMapItems.qml
index 131df90fe..541ea349b 100644
--- a/src/FlightMap/MapItems/PlanMapItems.qml
+++ b/src/FlightMap/MapItems/PlanMapItems.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FlightMap
// Adds visual items associated with the Flight Plan to the map.
// Currently only used by Fly View even though it's called PlanMapItems!
diff --git a/src/FlightMap/MapItems/PolygonEditor.qml b/src/FlightMap/MapItems/PolygonEditor.qml
index c7096d9bb..ba09d851a 100644
--- a/src/FlightMap/MapItems/PolygonEditor.qml
+++ b/src/FlightMap/MapItems/PolygonEditor.qml
@@ -7,12 +7,12 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtLocation 5.3
+import QtQuick
+import QtLocation
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
/// Polygon drawing item. Add to your control and call methods to get support for polygon drawing and adjustment.
@@ -76,9 +76,9 @@ Item {
adjustingPolygon = true
for (var i=0; i {
if (mouse.button == Qt.LeftButton) {
justClicked = true
if (_newPolygon.path.length > 2) {
@@ -269,7 +269,7 @@ Item {
}
}
- onPositionChanged: {
+ onPositionChanged: (mouse) => {
if (ScreenTools.isMobile) {
// We don't track mouse drag on mobile
return
diff --git a/src/FlightMap/MapItems/ProximityRadarMapView.qml b/src/FlightMap/MapItems/ProximityRadarMapView.qml
index c0933a011..192816e16 100644
--- a/src/FlightMap/MapItems/ProximityRadarMapView.qml
+++ b/src/FlightMap/MapItems/ProximityRadarMapView.qml
@@ -7,16 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightDisplay 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FlightDisplay
MapQuickItem {
id: _root
diff --git a/src/FlightMap/MapItems/SplitIndicator.qml b/src/FlightMap/MapItems/SplitIndicator.qml
index 0a46e6995..c0afbafa7 100644
--- a/src/FlightMap/MapItems/SplitIndicator.qml
+++ b/src/FlightMap/MapItems/SplitIndicator.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
Rectangle {
id: _root
diff --git a/src/FlightMap/MapItems/VehicleMapItem.qml b/src/FlightMap/MapItems/VehicleMapItem.qml
index 49c810601..988b5026c 100644
--- a/src/FlightMap/MapItems/VehicleMapItem.qml
+++ b/src/FlightMap/MapItems/VehicleMapItem.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtLocation
+import QtPositioning
+import Qt5Compat.GraphicalEffects
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
/// Marker for displaying a vehicle location on the map
MapQuickItem {
diff --git a/src/FlightMap/MapScale.qml b/src/FlightMap/MapScale.qml
index 6502b4d53..97d972e99 100644
--- a/src/FlightMap/MapScale.qml
+++ b/src/FlightMap/MapScale.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.SettingsManager 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.SettingsManager
/// Map scale control
Item {
diff --git a/src/FlightMap/QGCVideoBackground.qml b/src/FlightMap/QGCVideoBackground.qml
index f2de43c22..a8f39aac0 100644
--- a/src/FlightMap/QGCVideoBackground.qml
+++ b/src/FlightMap/QGCVideoBackground.qml
@@ -14,9 +14,9 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import org.freedesktop.gstreamer.GLVideoItem 1.0
+import QtQuick
+import QtQuick.Controls
+import org.freedesktop.gstreamer.GLVideoItem
GstGLVideoItem {
id: videoBackground
diff --git a/src/FlightMap/Widgets/CenterMapDropButton.qml b/src/FlightMap/Widgets/CenterMapDropButton.qml
index eaeb86a83..7bc3de93c 100644
--- a/src/FlightMap/Widgets/CenterMapDropButton.qml
+++ b/src/FlightMap/Widgets/CenterMapDropButton.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
DropButton {
id: dropButton
diff --git a/src/FlightMap/Widgets/CenterMapDropPanel.qml b/src/FlightMap/Widgets/CenterMapDropPanel.qml
index f3cf21d3f..ebcc14414 100644
--- a/src/FlightMap/Widgets/CenterMapDropPanel.qml
+++ b/src/FlightMap/Widgets/CenterMapDropPanel.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
ColumnLayout {
id: root
diff --git a/src/FlightMap/Widgets/CompassRing.qml b/src/FlightMap/Widgets/CompassRing.qml
index be52300ef..9bbe4ae35 100644
--- a/src/FlightMap/Widgets/CompassRing.qml
+++ b/src/FlightMap/Widgets/CompassRing.qml
@@ -7,12 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtGraphicalEffects 1.0
+import QtQuick
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
Item {
property real size: _defaultSize
diff --git a/src/FlightMap/Widgets/MapFitFunctions.qml b/src/FlightMap/Widgets/MapFitFunctions.qml
index e8a3f6bdf..b4b5fa437 100644
--- a/src/FlightMap/Widgets/MapFitFunctions.qml
+++ b/src/FlightMap/Widgets/MapFitFunctions.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtPositioning 5.3
+import QtQuick
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.FlightMap
/// Set of functions for fitting the map view to a specific constraint
Item {
diff --git a/src/FlightMap/Widgets/PhotoVideoControl.qml b/src/FlightMap/Widgets/PhotoVideoControl.qml
index 73eeee415..874beba07 100644
--- a/src/FlightMap/Widgets/PhotoVideoControl.qml
+++ b/src/FlightMap/Widgets/PhotoVideoControl.qml
@@ -7,21 +7,20 @@
*
****************************************************************************/
-import QtQuick 2.4
-import QtPositioning 5.2
-import QtQuick.Layouts 1.2
-import QtQuick.Controls 1.4
-import QtQuick.Dialogs 1.2
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtPositioning
+import QtQuick.Layouts
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Vehicle
+import QGroundControl.Controllers
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
Rectangle {
height: mainLayout.height + (_margins * 2)
@@ -326,7 +325,7 @@ Rectangle {
QGCPopupDialog {
title: qsTr("Settings")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
ColumnLayout {
spacing: _margins
@@ -438,10 +437,10 @@ Rectangle {
QGCSlider {
Layout.fillWidth: true
- maximumValue: 100
- minimumValue: 0
+ to: 100
+ from: 0
value: _mavlinkCamera ? _mavlinkCamera.thermalOpacity : 0
- updateValueWhileDragging: true
+ live: true
visible: _mavlinkCameraHasThermalVideoStream && _mavlinkCamera.thermalMode === QGCCameraControl.THERMAL_BLEND
onValueChanged: _mavlinkCamera.thermalOpacity = value
}
@@ -474,11 +473,11 @@ Rectangle {
}
QGCSlider {
Layout.fillWidth: true
- maximumValue: parent._fact.max
- minimumValue: parent._fact.min
+ to: parent._fact.max
+ from: parent._fact.min
stepSize: parent._fact.increment
visible: parent._isSlider
- updateValueWhileDragging: false
+ live: false
property bool initialized: false
onValueChanged: {
@@ -512,12 +511,12 @@ Rectangle {
QGCSlider {
Layout.fillWidth: true
- maximumValue: 60
- minimumValue: 1
+ to: 60
+ from: 1
stepSize: 1
value: _mavlinkCamera ? _mavlinkCamera.photoLapse : 5
displayValue: true
- updateValueWhileDragging: true
+ live: true
visible: _mavlinkCameraInPhotoMode && _mavlinkCamera.photoMode === QGCCameraControl.PHOTO_CAPTURE_TIMELAPSE
onValueChanged: {
if (_mavlinkCamera) {
@@ -549,11 +548,18 @@ Rectangle {
id: resetPrompt
title: qsTr("Reset Camera to Factory Settings")
text: qsTr("Confirm resetting all settings?")
- standardButtons: StandardButton.Yes | StandardButton.No
- onNo: resetPrompt.close()
- onYes: {
- _mavlinkCamera.resetSettings()
- resetPrompt.close()
+ buttons: MessageDialog.Yes | MessageDialog.No
+
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ _mavlinkCamera.resetSettings()
+ resetPrompt.close()
+ break;
+ case MessageDialog.No:
+ resetPrompt.close()
+ break;
+ }
}
}
}
@@ -567,11 +573,18 @@ Rectangle {
id: formatPrompt
title: qsTr("Format Camera Storage")
text: qsTr("Confirm erasing all files?")
- standardButtons: StandardButton.Yes | StandardButton.No
- onNo: formatPrompt.close()
- onYes: {
- _mavlinkCamera.formatCard()
- formatPrompt.close()
+ buttons: MessageDialog.Yes | MessageDialog.No
+
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ _mavlinkCamera.formatCard()
+ formatPrompt.close()
+ break;
+ case MessageDialog.No:
+ formatPrompt.close()
+ break;
+ }
}
}
}
diff --git a/src/FlightMap/Widgets/QGCArtificialHorizon.qml b/src/FlightMap/Widgets/QGCArtificialHorizon.qml
index bd9f9ea40..a94d8f7e9 100644
--- a/src/FlightMap/Widgets/QGCArtificialHorizon.qml
+++ b/src/FlightMap/Widgets/QGCArtificialHorizon.qml
@@ -14,7 +14,7 @@
* @author Gus Grubba
*/
-import QtQuick 2.3
+import QtQuick
Item {
id: root
diff --git a/src/FlightMap/Widgets/QGCAttitudeHUD.qml b/src/FlightMap/Widgets/QGCAttitudeHUD.qml
index a915aa46e..482952661 100644
--- a/src/FlightMap/Widgets/QGCAttitudeHUD.qml
+++ b/src/FlightMap/Widgets/QGCAttitudeHUD.qml
@@ -14,8 +14,8 @@
* @author Gus Grubba
*/
-import QtQuick 2.3
-import QGroundControl.ScreenTools 1.0
+import QtQuick
+import QGroundControl.ScreenTools
Item {
id: root
diff --git a/src/FlightMap/Widgets/QGCAttitudeWidget.qml b/src/FlightMap/Widgets/QGCAttitudeWidget.qml
index 7c8f65d6d..fbcc3b87b 100644
--- a/src/FlightMap/Widgets/QGCAttitudeWidget.qml
+++ b/src/FlightMap/Widgets/QGCAttitudeWidget.qml
@@ -14,13 +14,13 @@
* @author Gus Grubba
*/
-import QtQuick 2.3
-import QtGraphicalEffects 1.0
+import QtQuick
+import Qt5Compat.GraphicalEffects
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
Item {
id: root
diff --git a/src/FlightMap/Widgets/QGCCompassWidget.qml b/src/FlightMap/Widgets/QGCCompassWidget.qml
index f1f1a3846..4a73d8e4b 100644
--- a/src/FlightMap/Widgets/QGCCompassWidget.qml
+++ b/src/FlightMap/Widgets/QGCCompassWidget.qml
@@ -14,14 +14,14 @@
* @author Gus Grubba
*/
-import QtQuick 2.3
-import QtGraphicalEffects 1.0
+import QtQuick
+import Qt5Compat.GraphicalEffects
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Palette
Item {
id: root
diff --git a/src/FlightMap/Widgets/QGCInstrumentWidget.qml b/src/FlightMap/Widgets/QGCInstrumentWidget.qml
index 0c69160a2..9602a3989 100644
--- a/src/FlightMap/Widgets/QGCInstrumentWidget.qml
+++ b/src/FlightMap/Widgets/QGCInstrumentWidget.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.FactSystem
+import QGroundControl.FlightMap
+import QGroundControl.FlightDisplay
+import QGroundControl.Palette
ColumnLayout {
id: root
diff --git a/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml b/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml
index 1c4b2b853..14a33dc05 100644
--- a/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml
+++ b/src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.FactSystem
+import QGroundControl.FlightMap
+import QGroundControl.Palette
Rectangle {
height: _outerRadius * 4
diff --git a/src/FlightMap/Widgets/QGCMapToolButton.qml b/src/FlightMap/Widgets/QGCMapToolButton.qml
deleted file mode 100644
index ea26e9914..000000000
--- a/src/FlightMap/Widgets/QGCMapToolButton.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-import QtQuick 2.2
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.2
-import QtQuick.Controls.Private 1.0
-
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-
-Button {
- property var imageSource: undefined
- property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
- property bool __showHighlight: (pressed | hovered | checked) && !__forceHoverOff
-
- // This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can
- // move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn
- // cause the hover property to not be cleared correctly.
-
- property bool __forceHoverOff: false
- property int __lastGlobalMouseX: 0
- property int __lastGlobalMouseY: 0
-
- Connections {
- target: __behavior
- onMouseXChanged: {
- __lastGlobalMouseX = ScreenTools.mouseX()
- __lastGlobalMouseY = ScreenTools.mouseY()
- }
- onMouseYChanged: {
- __lastGlobalMouseX = ScreenTools.mouseX()
- __lastGlobalMouseY = ScreenTools.mouseY()
- }
- onEntered: { __forceHoverOff; false; hoverTimer.start() }
- onExited: { __forceHoverOff; false; hoverTimer.stop() }
- }
-
- Timer {
- id: hoverTimer
- interval: 250
- repeat: true
- onTriggered: {
- if (__lastGlobalMouseX != ScreenTools.mouseX() || __lastGlobalMouseY != ScreenTools.mouseY()) {
- __forceHoverOff = true
- } else {
- __forceHoverOff = false
- }
- }
- }
-
- style: ButtonStyle {
- /*! This defines the background of the button. */
- background: Item {
- property bool __checked: (control.checkable && control.checked)
-
- Rectangle {
- id: backgroundRectangle
- anchors.fill: parent
- color: __showHighlight ? __qgcPal.buttonHighlight : (__checked ? __qgcPal.buttonHighlight : __qgcPal.window);
- }
-
- QGCColoredImage {
- id: image
- anchors.fill: parent
- opacity: control.enabled ? 0.6 : 0.5
- source: imageSource
- color: __showHighlight ? __qgcPal.buttonHighlightText : (__checked ? __qgcPal.primaryButtonText : __qgcPal.buttonText)
- }
- }
- }
-}
diff --git a/src/FlightMap/Widgets/QGCPitchIndicator.qml b/src/FlightMap/Widgets/QGCPitchIndicator.qml
index 5d70ecaf7..8c365f47d 100644
--- a/src/FlightMap/Widgets/QGCPitchIndicator.qml
+++ b/src/FlightMap/Widgets/QGCPitchIndicator.qml
@@ -14,9 +14,9 @@
* @author Gus Grubba
*/
-import QtQuick 2.3
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QtQuick
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
Rectangle {
property real pitchAngle: 0
diff --git a/src/FlightMap/Widgets/QGCWaypointEditor.qml b/src/FlightMap/Widgets/QGCWaypointEditor.qml
index d798199cb..a5505b295 100644
--- a/src/FlightMap/Widgets/QGCWaypointEditor.qml
+++ b/src/FlightMap/Widgets/QGCWaypointEditor.qml
@@ -14,13 +14,13 @@
* @author Gus Grubba
*/
-import QtQuick 2.4
+import QtQuick
-import QGroundControl.Palette 1.0
+import QGroundControl.Palette
Rectangle {
- QGCPalette { id: palette; colorGroupEnabled: true }
+ QGCPalette { id: qgcPal; colorGroupEnabled: true }
id: root
- color: palette.window
+ color: qgcPal.window
}
diff --git a/src/GPS/RTCM/RTCMMavlink.cc b/src/GPS/RTCM/RTCMMavlink.cc
index 35113793c..f859a9ab9 100644
--- a/src/GPS/RTCM/RTCMMavlink.cc
+++ b/src/GPS/RTCM/RTCMMavlink.cc
@@ -32,7 +32,7 @@ void RTCMMavlink::RTCMDataUpdate(QByteArray message)
_bandwidthByteCounter = 0;
}
- const int maxMessageLength = MAVLINK_MSG_GPS_RTCM_DATA_FIELD_DATA_LEN;
+ const qsizetype maxMessageLength = MAVLINK_MSG_GPS_RTCM_DATA_FIELD_DATA_LEN;
mavlink_gps_rtcm_data_t mavlinkRtcmData;
memset(&mavlinkRtcmData, 0, sizeof(mavlink_gps_rtcm_data_t));
diff --git a/src/JsonHelper.cc b/src/JsonHelper.cc
index 82579c829..683a407dc 100644
--- a/src/JsonHelper.cc
+++ b/src/JsonHelper.cc
@@ -42,7 +42,7 @@ bool JsonHelper::validateRequiredKeys(const QJsonObject& jsonObject, const QStri
}
}
- if (missingKeys.count() != 0) {
+ if (missingKeys.length() != 0) {
errorString = QObject::tr("The following required keys are missing: %1").arg(missingKeys);
return false;
}
@@ -68,7 +68,7 @@ bool JsonHelper::_loadGeoCoordinate(const QJsonValue& jsonValue,
return false;
}
- foreach(const QJsonValue& jsonValue, coordinateArray) {
+ for (const auto& jsonValue: coordinateArray) {
if (jsonValue.type() != QJsonValue::Double && jsonValue.type() != QJsonValue::Null) {
errorString = QObject::tr("Coordinate array may only contain double values, found: %1").arg(jsonValue.type());
return false;
@@ -167,7 +167,7 @@ bool JsonHelper::isJsonFile(const QByteArray& bytes, QJsonDocument& jsonDoc, QSt
return true;
} else {
int startPos = qMax(0, parseError.offset - 100);
- int length = qMin(bytes.count() - startPos, 200);
+ int length = qMin(bytes.length() - startPos, 200);
qDebug() << QStringLiteral("Json read error '%1'").arg(bytes.mid(startPos, length).constData());
errorString = parseError.errorString();
return false;
diff --git a/src/Microhard/MicrohardSettings.qml b/src/Microhard/MicrohardSettings.qml
index 6f0a6fe6f..14b491c42 100644
--- a/src/Microhard/MicrohardSettings.qml
+++ b/src/Microhard/MicrohardSettings.qml
@@ -8,24 +8,23 @@
****************************************************************************/
-import QtGraphicalEffects 1.0
-import QtMultimedia 5.5
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtMultimedia
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.SettingsManager 1.0
+import QGroundControl
+import QGroundControl.Controllers
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.FactSystem
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl.SettingsManager
Rectangle {
id: _root
diff --git a/src/MissionManager/MapLineArrow.qml b/src/MissionManager/MapLineArrow.qml
index cb68d0240..89bcaed36 100644
--- a/src/MissionManager/MapLineArrow.qml
+++ b/src/MissionManager/MapLineArrow.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
MapQuickItem {
property color arrowColor: "white"
diff --git a/src/MissionManager/MissionCommandTreeEditorTestWindow.qml b/src/MissionManager/MissionCommandTreeEditorTestWindow.qml
index d8be76d43..d131ff5f0 100644
--- a/src/MissionManager/MissionCommandTreeEditorTestWindow.qml
+++ b/src/MissionManager/MissionCommandTreeEditorTestWindow.qml
@@ -7,19 +7,19 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.11
-import QtQuick.Window 2.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Window
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.FlightDisplay
+import QGroundControl.FlightMap
+import QGroundControl.Controllers
ApplicationWindow {
id: _root
diff --git a/src/MissionManager/MissionController.h b/src/MissionManager/MissionController.h
index 0448e261b..9f1dfbb41 100644
--- a/src/MissionManager/MissionController.h
+++ b/src/MissionManager/MissionController.h
@@ -31,6 +31,13 @@ class TakeoffMissionItem;
class QDomDocument;
class PlanViewSettings;
+#ifndef OPAQUE_PTR_MissionController
+ #define OPAQUE_PTR_MissionController
+ Q_DECLARE_OPAQUE_POINTER(FlightPathSegment*)
+ Q_DECLARE_OPAQUE_POINTER(VisualMissionItem*)
+ Q_DECLARE_OPAQUE_POINTER(TakeoffMissionItem*)
+#endif
+
Q_DECLARE_LOGGING_CATEGORY(MissionControllerLog)
typedef QPair VisualItemPair;
diff --git a/src/MissionManager/PlanElementController.h b/src/MissionManager/PlanElementController.h
index c085887cd..d0d46715c 100644
--- a/src/MissionManager/PlanElementController.h
+++ b/src/MissionManager/PlanElementController.h
@@ -17,6 +17,11 @@
class PlanMasterController;
+#ifndef OPAQUE_PTR_PlanElementController
+ #define OPAQUE_PTR_PlanElementController
+ Q_DECLARE_OPAQUE_POINTER(PlanMasterController*)
+#endif
+
/// This is the abstract base clas for Plan Element controllers.
/// Examples of plan elements are: missions (MissionController), geofence (GeoFenceController)
class PlanElementController : public QObject
diff --git a/src/MissionManager/QGCMapCircleVisuals.qml b/src/MissionManager/QGCMapCircleVisuals.qml
index 0a2dfb547..f08563902 100644
--- a/src/MissionManager/QGCMapCircleVisuals.qml
+++ b/src/MissionManager/QGCMapCircleVisuals.qml
@@ -7,17 +7,17 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Shapes 1.12
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Shapes
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
/// QGCMapCircle map visuals
Item {
diff --git a/src/MissionManager/QGCMapPolygonVisuals.qml b/src/MissionManager/QGCMapPolygonVisuals.qml
index 95e4dd746..05102f374 100644
--- a/src/MissionManager/QGCMapPolygonVisuals.qml
+++ b/src/MissionManager/QGCMapPolygonVisuals.qml
@@ -7,19 +7,19 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.ShapeFileHelper 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
+import QGroundControl.ShapeFileHelper
/// QGCMapPolygon map visuals
Item {
@@ -218,9 +218,8 @@ Item {
KMLOrSHPFileDialog {
id: kmlOrSHPLoadDialog
title: qsTr("Select Polygon File")
- selectExisting: true
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
mapPolygon.loadKMLOrSHPFile(file)
mapFitFunctions.fitMapViewportToMissionItems()
close()
@@ -575,7 +574,7 @@ Item {
preventStealing: true
z: QGroundControl.zOrderMapItems + 1 // Over item indicators
- onClicked: {
+ onClicked: (mouse) => {
if (mouse.button === Qt.LeftButton && _root.interactive) {
mapPolygon.appendVertex(mapControl.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */))
}
diff --git a/src/MissionManager/QGCMapPolylineVisuals.qml b/src/MissionManager/QGCMapPolylineVisuals.qml
index deb582997..3735a4770 100644
--- a/src/MissionManager/QGCMapPolylineVisuals.qml
+++ b/src/MissionManager/QGCMapPolylineVisuals.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.ShapeFileHelper 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
+import QGroundControl.ShapeFileHelper
/// QGCMapPolyline map visuals
Item {
@@ -126,10 +126,9 @@ Item {
id: kmlLoadDialog
folder: QGroundControl.settingsManager.appSettings.missionSavePath
title: qsTr("Select KML File")
- selectExisting: true
nameFilters: ShapeFileHelper.fileDialogKMLFilters
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
mapPolyline.loadKMLFile(file)
close()
}
@@ -371,7 +370,7 @@ Item {
preventStealing: true
z: QGroundControl.zOrderMapItems + 1 // Over item indicators
- onClicked: {
+ onClicked: (mouse) => {
if (mouse.button === Qt.LeftButton && _root.interactive) {
mapPolyline.appendVertex(mapControl.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */))
}
diff --git a/src/MissionManager/Survey.SettingsGroup.json b/src/MissionManager/Survey.SettingsGroup.json
index 86082a60e..5acaa7114 100644
--- a/src/MissionManager/Survey.SettingsGroup.json
+++ b/src/MissionManager/Survey.SettingsGroup.json
@@ -23,7 +23,8 @@
"name": "SplitConcavePolygons",
"shortDesc": "Split mission concave polygons into separate regular, convex polygons.",
"type": "bool",
- "default": false
+ "default": false,
+ "comment": "Although this setting is here, the code for it is disabled since it was not working."
}
]
}
diff --git a/src/MissionManager/SurveyComplexItem.cc b/src/MissionManager/SurveyComplexItem.cc
index ebc63ceeb..4a86092f9 100644
--- a/src/MissionManager/SurveyComplexItem.cc
+++ b/src/MissionManager/SurveyComplexItem.cc
@@ -672,18 +672,9 @@ double SurveyComplexItem::_turnaroundDistance(void) const
void SurveyComplexItem::_rebuildTransectsPhase1(void)
{
- bool split = splitConcavePolygons()->rawValue().toBool();
- if (split) {
- _rebuildTransectsPhase1WorkerSplitPolygons(false /* refly */);
- } else {
- _rebuildTransectsPhase1WorkerSinglePolygon(false /* refly */);
- }
+ _rebuildTransectsPhase1WorkerSinglePolygon(false /* refly */);
if (_refly90DegreesFact.rawValue().toBool()) {
- if (split) {
- _rebuildTransectsPhase1WorkerSplitPolygons(true /* refly */);
- } else {
- _rebuildTransectsPhase1WorkerSinglePolygon(true /* refly */);
- }
+ _rebuildTransectsPhase1WorkerSinglePolygon(true /* refly */);
}
}
@@ -902,6 +893,9 @@ void SurveyComplexItem::_rebuildTransectsPhase1WorkerSinglePolygon(bool refly)
}
}
+#if 0
+ // Splitting polygons is not supported since this code would get stuck in a infinite loop
+ // Code is left here in case someone wants to try to resurrect it
void SurveyComplexItem::_rebuildTransectsPhase1WorkerSplitPolygons(bool refly)
{
@@ -1117,14 +1111,14 @@ bool SurveyComplexItem::_VertexCanSeeOther(const QPolygonF& polygon, const QPoin
return visible;
}
-bool SurveyComplexItem::_VertexIsReflex(const QPolygonF& polygon, const QPointF* vertex) {
+bool SurveyComplexItem::_VertexIsReflex(const QPolygonF& polygon, QList::const_iterator& vertexIter) {
auto vertexBefore = vertex == polygon.begin() ? polygon.end() - 1 : vertex - 1;
auto vertexAfter = vertex == polygon.end() - 1 ? polygon.begin() : vertex + 1;
auto area = (((vertex->x() - vertexBefore->x())*(vertexAfter->y() - vertexBefore->y()))-((vertexAfter->x() - vertexBefore->x())*(vertex->y() - vertexBefore->y())));
return area > 0;
}
-
+#endif
void SurveyComplexItem::_rebuildTransectsFromPolygon(bool refly, const QPolygonF& polygon, const QGeoCoordinate& tangentOrigin, const QPointF* const transitionPoint)
{
diff --git a/src/MissionManager/SurveyComplexItem.h b/src/MissionManager/SurveyComplexItem.h
index 1ad3fee86..c8b895d55 100644
--- a/src/MissionManager/SurveyComplexItem.h
+++ b/src/MissionManager/SurveyComplexItem.h
@@ -125,14 +125,21 @@ private:
void _saveCommon(QJsonObject& complexObject);
void _rebuildTransectsPhase1Worker(bool refly);
void _rebuildTransectsPhase1WorkerSinglePolygon(bool refly);
- void _rebuildTransectsPhase1WorkerSplitPolygons(bool refly);
/// Adds to the _transects array from one polygon
void _rebuildTransectsFromPolygon(bool refly, const QPolygonF& polygon, const QGeoCoordinate& tangentOrigin, const QPointF* const transitionPoint);
+
+#if 0
+ // Splitting polygons is not supported since this code would get stuck in a infinite loop
+ // Code is left here in case someone wants to try to resurrect it
+
+ void _rebuildTransectsPhase1WorkerSplitPolygons(bool refly);
+
// Decompose polygon into list of convex sub polygons
void _PolygonDecomposeConvex(const QPolygonF& polygon, QList& decomposedPolygons);
// return true if vertex a can see vertex b
bool _VertexCanSeeOther(const QPolygonF& polygon, const QPointF* vertexA, const QPointF* vertexB);
- bool _VertexIsReflex(const QPolygonF& polygon, const QPointF* vertex);
+ bool _VertexIsReflex(const QPolygonF& polygon, QList::const_iterator& vertexIter);
+#endif
QMap _metaDataMap;
diff --git a/src/PlanView/CameraCalcCamera.qml b/src/PlanView/CameraCalcCamera.qml
index c4c0acf55..b0818f011 100644
--- a/src/PlanView/CameraCalcCamera.qml
+++ b/src/PlanView/CameraCalcCamera.qml
@@ -1,12 +1,12 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
// Camera calculator "Camera" section for mission item editors
ColumnLayout {
diff --git a/src/PlanView/CameraCalcGrid.qml b/src/PlanView/CameraCalcGrid.qml
index 495051237..152ae9f6f 100644
--- a/src/PlanView/CameraCalcGrid.qml
+++ b/src/PlanView/CameraCalcGrid.qml
@@ -1,12 +1,12 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
// Camera calculator "Grid" section for mission item editors
Column {
diff --git a/src/PlanView/CameraSection.qml b/src/PlanView/CameraSection.qml
index bf291af30..61cca71c1 100644
--- a/src/PlanView/CameraSection.qml
+++ b/src/PlanView/CameraSection.qml
@@ -1,12 +1,12 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
// Camera section for mission item editors
Column {
@@ -14,7 +14,7 @@ Column {
anchors.right: parent.right
spacing: _margin
- property alias exclusiveGroup: cameraSectionHeader.exclusiveGroup
+ property alias buttonGroup: cameraSectionHeader.buttonGroup
property alias showSpacer: cameraSectionHeader.showSpacer
property alias checked: cameraSectionHeader.checked
diff --git a/src/PlanView/CorridorScanEditor.qml b/src/PlanView/CorridorScanEditor.qml
index 5de33ab22..5020a4ab9 100644
--- a/src/PlanView/CorridorScanEditor.qml
+++ b/src/PlanView/CorridorScanEditor.qml
@@ -1,17 +1,16 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Extras 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.FlightMap
TransectStyleComplexItemEditor {
transectAreaDefinitionComplete: _missionItem.corridorPolyline.isValid
diff --git a/src/PlanView/CorridorScanMapVisual.qml b/src/PlanView/CorridorScanMapVisual.qml
index 5104da6bb..18b4c14ea 100644
--- a/src/PlanView/CorridorScanMapVisual.qml
+++ b/src/PlanView/CorridorScanMapVisual.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.Controls
/// Corridor Scan Complex Mission Item visuals
TransectStyleMapVisuals {
diff --git a/src/PlanView/FWLandingPatternEditor.qml b/src/PlanView/FWLandingPatternEditor.qml
index 0745fb690..be1d8d189 100644
--- a/src/PlanView/FWLandingPatternEditor.qml
+++ b/src/PlanView/FWLandingPatternEditor.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
// Editor for Fixed Wing Landing Pattern complex mission item
Rectangle {
diff --git a/src/PlanView/FWLandingPatternMapVisual.qml b/src/PlanView/FWLandingPatternMapVisual.qml
index 6c38469c5..4d6033322 100644
--- a/src/PlanView/FWLandingPatternMapVisual.qml
+++ b/src/PlanView/FWLandingPatternMapVisual.qml
@@ -7,17 +7,17 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
/// Fixed Wing Landing Pattern map visuals
Item {
@@ -199,7 +199,7 @@ Item {
readonly property int _decimalPlaces: 8
- onClicked: {
+ onClicked: (mouse) => {
var coordinate = map.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)
coordinate.latitude = coordinate.latitude.toFixed(_decimalPlaces)
coordinate.longitude = coordinate.longitude.toFixed(_decimalPlaces)
diff --git a/src/PlanView/GeoFenceEditor.qml b/src/PlanView/GeoFenceEditor.qml
index f145c12d3..5c77a3968 100644
--- a/src/PlanView/GeoFenceEditor.qml
+++ b/src/PlanView/GeoFenceEditor.qml
@@ -1,13 +1,13 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
-import QtPositioning 5.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
QGCFlickable {
id: root
diff --git a/src/PlanView/GeoFenceMapVisuals.qml b/src/PlanView/GeoFenceMapVisuals.qml
index 4b2e53b9b..858cc30a2 100644
--- a/src/PlanView/GeoFenceMapVisuals.qml
+++ b/src/PlanView/GeoFenceMapVisuals.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
/// GeoFence map visuals
Item {
diff --git a/src/PlanView/MissionItemEditor.qml b/src/PlanView/MissionItemEditor.qml
index 00e1a548d..c2abeaed4 100644
--- a/src/PlanView/MissionItemEditor.qml
+++ b/src/PlanView/MissionItemEditor.qml
@@ -1,16 +1,16 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQml 2.2
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQml
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
/// Mission item edit control
@@ -204,8 +204,7 @@ Rectangle {
QGCMenuItem {
text: qsTr("Move to vehicle position")
- visible: missionItem.specifiesCoordinate
- enabled: _activeVehicle
+ enabled: _activeVehicle && missionItem.specifiesCoordinate
onTriggered: missionItem.coordinate = _activeVehicle.coordinate
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
@@ -213,25 +212,25 @@ Rectangle {
QGCMenuItem {
text: qsTr("Move to previous item position")
- visible: _missionController.previousCoordinate.isValid
+ enabled: _missionController.previousCoordinate.isValid
onTriggered: missionItem.coordinate = _missionController.previousCoordinate
}
QGCMenuItem {
text: qsTr("Edit position...")
- visible: missionItem.specifiesCoordinate
+ enabled: missionItem.specifiesCoordinate
onTriggered: editPositionDialog.createObject(mainWindow).open()
}
QGCMenuSeparator {
- visible: missionItem.isSimpleItem && !_waypointsOnlyMode
+ //visible: missionItem.isSimpleItem && !_waypointsOnlyMode
}
QGCMenuItem {
text: qsTr("Show all values")
checkable: true
checked: missionItem.isSimpleItem ? missionItem.rawEdit : false
- visible: missionItem.isSimpleItem && !_waypointsOnlyMode
+ enabled: missionItem.isSimpleItem && !_waypointsOnlyMode
onTriggered: {
if (missionItem.rawEdit) {
diff --git a/src/PlanView/MissionItemMapVisual.qml b/src/PlanView/MissionItemMapVisual.qml
index bb1414ac1..e3eb848ab 100644
--- a/src/PlanView/MissionItemMapVisual.qml
+++ b/src/PlanView/MissionItemMapVisual.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
/// Mission item map visual
diff --git a/src/PlanView/MissionItemStatus.qml b/src/PlanView/MissionItemStatus.qml
index db0e9eec2..96f12d09b 100644
--- a/src/PlanView/MissionItemStatus.qml
+++ b/src/PlanView/MissionItemStatus.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
Rectangle {
id: root
diff --git a/src/PlanView/MissionSettingsEditor.qml b/src/PlanView/MissionSettingsEditor.qml
index 5e8ae2478..76189fc80 100644
--- a/src/PlanView/MissionSettingsEditor.qml
+++ b/src/PlanView/MissionSettingsEditor.qml
@@ -1,15 +1,15 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.SettingsManager 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.SettingsManager
+import QGroundControl.Controllers
// Editor for Mission Settings
Rectangle {
diff --git a/src/PlanView/PlanEditToolbar.qml b/src/PlanView/PlanEditToolbar.qml
index 1703387d8..843119de3 100644
--- a/src/PlanView/PlanEditToolbar.qml
+++ b/src/PlanView/PlanEditToolbar.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
/// Toolbar used for things like Polygon editing tools
Item {
diff --git a/src/PlanView/PlanToolBar.qml b/src/PlanView/PlanToolBar.qml
index 3fdcc7841..087c1153a 100644
--- a/src/PlanView/PlanToolBar.qml
+++ b/src/PlanView/PlanToolBar.qml
@@ -1,13 +1,13 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
// Toolbar for Plan View
Rectangle {
diff --git a/src/PlanView/PlanToolBarIndicators.qml b/src/PlanView/PlanToolBarIndicators.qml
index 62224d536..6b394e0fe 100644
--- a/src/PlanView/PlanToolBarIndicators.qml
+++ b/src/PlanView/PlanToolBarIndicators.qml
@@ -1,13 +1,13 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
// Toolbar for Plan View
Item {
diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml
index 98ad6ff49..2c7bbe90a 100644
--- a/src/PlanView/PlanView.qml
+++ b/src/PlanView/PlanView.qml
@@ -7,23 +7,23 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Layouts 1.2
-import QtQuick.Window 2.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtLocation
+import QtPositioning
+import QtQuick.Layouts
+import QtQuick.Window
-import QGroundControl 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ShapeFileHelper 1.0
+import QGroundControl
+import QGroundControl.FlightMap
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controllers
+import QGroundControl.ShapeFileHelper
Item {
id: _root
@@ -95,7 +95,7 @@ Item {
if (_visualItems.count > 1) {
mainWindow.showMessageDialog(qsTr("Apply new altitude"),
qsTr("You have changed the default altitude for mission items. Would you like to apply that altitude to all the items in the current mission?"),
- StandardButton.Yes | StandardButton.No,
+ Dialog.Yes | Dialog.No,
function() { _missionController.applyDefaultMissionAltitude() })
}
}
@@ -105,7 +105,7 @@ Item {
id: promptForPlanUsageOnVehicleChangePopupComponent
QGCPopupDialog {
title: _planMasterController.managerVehicle.isOfflineEditingVehicle ? qsTr("Plan View - Vehicle Disconnected") : qsTr("Plan View - Vehicle Changed")
- buttons: StandardButton.NoButton
+ buttons: Dialog.NoButton
ColumnLayout {
QGCLabel {
@@ -202,7 +202,7 @@ Item {
"This can lead to errors or incorrect behavior. " +
"It is recommended to recreate the Plan for the correct firmware/vehicle type.\n\n" +
"Click 'Ok' to upload the Plan anyway."),
- StandardButton.Ok | StandardButton.Cancel,
+ Dialog.Ok | Dialog.Cancel,
function() { _planMasterController.sendToVehicle() })
break
}
@@ -211,7 +211,6 @@ Item {
function loadFromSelectedFile() {
fileDialog.title = qsTr("Select Plan File")
fileDialog.planFiles = true
- fileDialog.selectExisting = true
fileDialog.nameFilters = _planMasterController.loadNameFilters
fileDialog.openForLoad()
}
@@ -222,7 +221,6 @@ Item {
}
fileDialog.title = qsTr("Save Plan")
fileDialog.planFiles = true
- fileDialog.selectExisting = false
fileDialog.nameFilters = _planMasterController.saveNameFilters
fileDialog.openForSave()
}
@@ -237,7 +235,6 @@ Item {
}
fileDialog.title = qsTr("Save KML")
fileDialog.planFiles = false
- fileDialog.selectExisting = false
fileDialog.nameFilters = ShapeFileHelper.fileDialogKMLFilters
fileDialog.openForSave()
}
@@ -302,7 +299,7 @@ Item {
property bool planFiles: true ///< true: working with plan files, false: working with kml file
- onAcceptedForSave: {
+ onAcceptedForSave: (file) => {
if (planFiles) {
_planMasterController.saveToFile(file)
} else {
@@ -311,7 +308,7 @@ Item {
close()
}
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
_planMasterController.loadFromFile(file)
_planMasterController.fitViewportToItems()
_missionController.setCurrentPlanViewSeqNum(0, true)
@@ -347,15 +344,15 @@ Item {
QGCMapPalette { id: mapPal; lightColors: editorMap.isSatelliteMap }
onZoomLevelChanged: {
- QGroundControl.flightMapZoom = zoomLevel
+ QGroundControl.flightMapZoom = editorMap.zoomLevel
}
onCenterChanged: {
- QGroundControl.flightMapPosition = center
+ QGroundControl.flightMapPosition = editorMap.center
}
MouseArea {
anchors.fill: parent
- onClicked: {
+ onClicked: (mouse) => {
// Take focus to close any previous editing
editorMap.focus = true
var coordinate = editorMap.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)
@@ -780,7 +777,7 @@ Item {
function showLoadFromFileOverwritePrompt(title) {
mainWindow.showMessageDialog(title,
qsTr("You have unsaved/unsent changes. Loading from a file will lose these changes. Are you sure you want to load from a file?"),
- StandardButton.Yes | StandardButton.Cancel,
+ Dialog.Yes | Dialog.Cancel,
function() { _planMasterController.loadFromSelectedFile() } )
}
@@ -790,7 +787,7 @@ Item {
QGCSimpleMessageDialog {
title: qsTr("Create Plan")
text: qsTr("Are you sure you want to remove current plan and create a new plan? ")
- buttons: StandardButton.Yes | StandardButton.No
+ buttons: Dialog.Yes | Dialog.No
property var mapCenter
property var planCreator
@@ -802,7 +799,7 @@ Item {
function clearButtonClicked() {
mainWindow.showMessageDialog(qsTr("Clear"),
qsTr("Are you sure you want to remove all mission items and clear the mission from the vehicle?"),
- StandardButton.Yes | StandardButton.Cancel,
+ Dialog.Yes | Dialog.Cancel,
function() { _planMasterController.removeAllFromVehicle(); _missionController.setCurrentPlanViewSeqNum(0, true) })
}
@@ -845,7 +842,7 @@ Item {
if (_planMasterController.dirty) {
mainWindow.showMessageDialog(title,
qsTr("You have unsaved/unsent changes. Loading from the Vehicle will lose these changes. Are you sure you want to load from the Vehicle?"),
- StandardButton.Yes | StandardButton.Cancel,
+ Dialog.Yes | Dialog.Cancel,
function() { _planMasterController.loadFromVehicle() })
} else {
_planMasterController.loadFromVehicle()
diff --git a/src/PlanView/RallyPointEditorHeader.qml b/src/PlanView/RallyPointEditorHeader.qml
index 0e8283b34..56557e9d2 100644
--- a/src/PlanView/RallyPointEditorHeader.qml
+++ b/src/PlanView/RallyPointEditorHeader.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
QGCFlickable {
height: outerEditorRect.height
diff --git a/src/PlanView/RallyPointItemEditor.qml b/src/PlanView/RallyPointItemEditor.qml
index ceabf4044..71add974d 100644
--- a/src/PlanView/RallyPointItemEditor.qml
+++ b/src/PlanView/RallyPointItemEditor.qml
@@ -1,12 +1,12 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
Rectangle {
id: root
diff --git a/src/PlanView/RallyPointMapVisuals.qml b/src/PlanView/RallyPointMapVisuals.qml
index 81ef091e0..c82e770d2 100644
--- a/src/PlanView/RallyPointMapVisuals.qml
+++ b/src/PlanView/RallyPointMapVisuals.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
/// Rally Point map visuals
Item {
diff --git a/src/PlanView/SimpleItemEditor.qml b/src/PlanView/SimpleItemEditor.qml
index 24e711b5a..60ddb2306 100644
--- a/src/PlanView/SimpleItemEditor.qml
+++ b/src/PlanView/SimpleItemEditor.qml
@@ -1,14 +1,14 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
// Editor for Simple mission items
Rectangle {
diff --git a/src/PlanView/SimpleItemMapVisual.qml b/src/PlanView/SimpleItemMapVisual.qml
index fae8a7eb0..25327f279 100644
--- a/src/PlanView/SimpleItemMapVisual.qml
+++ b/src/PlanView/SimpleItemMapVisual.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
/// Simple Mission Item visuals
Item {
diff --git a/src/PlanView/StructureScanEditor.qml b/src/PlanView/StructureScanEditor.qml
index 913a8e679..9be465ae4 100644
--- a/src/PlanView/StructureScanEditor.qml
+++ b/src/PlanView/StructureScanEditor.qml
@@ -1,17 +1,17 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Extras 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Extras
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.FlightMap
// Editor for Survery mission items
Rectangle {
diff --git a/src/PlanView/StructureScanMapVisual.qml b/src/PlanView/StructureScanMapVisual.qml
index 4874fd9d6..cfa4e4335 100644
--- a/src/PlanView/StructureScanMapVisual.qml
+++ b/src/PlanView/StructureScanMapVisual.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
/// Structure Scan Complex Mission Item visuals
Item {
diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml
index 2bb490636..da74136ea 100644
--- a/src/PlanView/SurveyItemEditor.qml
+++ b/src/PlanView/SurveyItemEditor.qml
@@ -1,17 +1,16 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Extras 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.FlightMap
TransectStyleComplexItemEditor {
transectAreaDefinitionComplete: missionItem.surveyAreaPolygon.isValid
@@ -45,8 +44,8 @@ TransectStyleComplexItemEditor {
QGCSlider {
id: angleSlider
- minimumValue: 0
- maximumValue: 359
+ from: 0
+ to: 359
stepSize: 1
tickmarksEnabled: false
Layout.fillWidth: true
@@ -54,7 +53,7 @@ TransectStyleComplexItemEditor {
Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5
onValueChanged: missionItem.gridAngle.value = value
Component.onCompleted: value = missionItem.gridAngle.value
- updateValueWhileDragging: true
+ live: true
}
QGCLabel {
@@ -105,9 +104,8 @@ TransectStyleComplexItemEditor {
KMLOrSHPFileDialog {
id: kmlOrSHPLoadDialog
title: qsTr("Select Polygon File")
- selectExisting: true
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
missionItem.surveyAreaPolygon.loadKMLOrSHPFile(file)
missionItem.resetState = false
//editorMap.mapFitFunctions.fitMapViewportTomissionItems()
diff --git a/src/PlanView/SurveyMapVisual.qml b/src/PlanView/SurveyMapVisual.qml
index cbb305eb4..854137c58 100644
--- a/src/PlanView/SurveyMapVisual.qml
+++ b/src/PlanView/SurveyMapVisual.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
/// Survey Complex Mission Item visuals
TransectStyleMapVisuals {
diff --git a/src/PlanView/TakeoffItemMapVisual.qml b/src/PlanView/TakeoffItemMapVisual.qml
index 63d753407..e9355163a 100644
--- a/src/PlanView/TakeoffItemMapVisual.qml
+++ b/src/PlanView/TakeoffItemMapVisual.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
/// Simple Mission Item visuals
Item {
@@ -148,7 +148,7 @@ Item {
readonly property int _decimalPlaces: 8
- onClicked: {
+ onClicked: (mouse) => {
var coordinate = map.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)
coordinate.latitude = coordinate.latitude.toFixed(_decimalPlaces)
coordinate.longitude = coordinate.longitude.toFixed(_decimalPlaces)
diff --git a/src/PlanView/TerrainStatus.qml b/src/PlanView/TerrainStatus.qml
index fe3418de0..66fa59d9b 100644
--- a/src/PlanView/TerrainStatus.qml
+++ b/src/PlanView/TerrainStatus.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtCharts 2.3
+import QtQuick
+import QtCharts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
Rectangle {
id: root
diff --git a/src/PlanView/TransectStyleComplexItemEditor.qml b/src/PlanView/TransectStyleComplexItemEditor.qml
index acc385de7..fa29a27a8 100644
--- a/src/PlanView/TransectStyleComplexItemEditor.qml
+++ b/src/PlanView/TransectStyleComplexItemEditor.qml
@@ -1,17 +1,16 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Extras 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.FlightMap
Rectangle {
id: _root
@@ -192,7 +191,7 @@ Rectangle {
QGCSimpleMessageDialog {
title: qsTr("Delete Preset")
text: qsTr("Are you sure you want to delete '%1' preset?").arg(presetName)
- buttons: StandardButton.Yes | StandardButton.No
+ buttons: Dialog.Yes | Dialog.No
property string presetName
@@ -245,7 +244,7 @@ Rectangle {
QGCPopupDialog {
id: popupDialog
title: qsTr("Save Preset")
- buttons: StandardButton.Save | StandardButton.Cancel
+ buttons: Dialog.Save | Dialog.Cancel
onAccepted: {
if (presetNameField.text != "") {
diff --git a/src/PlanView/TransectStyleComplexItemStats.qml b/src/PlanView/TransectStyleComplexItemStats.qml
index 5253841e6..44b153ce3 100644
--- a/src/PlanView/TransectStyleComplexItemStats.qml
+++ b/src/PlanView/TransectStyleComplexItemStats.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
// Statistics section for TransectStyleComplexItems
Grid {
diff --git a/src/PlanView/TransectStyleComplexItemTabBar.qml b/src/PlanView/TransectStyleComplexItemTabBar.qml
index 72dc301f5..33430a9e9 100644
--- a/src/PlanView/TransectStyleComplexItemTabBar.qml
+++ b/src/PlanView/TransectStyleComplexItemTabBar.qml
@@ -1,8 +1,8 @@
-import QtQuick 2.3
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
QGCTabBar {
id: tabBar
diff --git a/src/PlanView/TransectStyleComplexItemTerrainFollow.qml b/src/PlanView/TransectStyleComplexItemTerrainFollow.qml
index 7dde52f5b..a9e845ae1 100644
--- a/src/PlanView/TransectStyleComplexItemTerrainFollow.qml
+++ b/src/PlanView/TransectStyleComplexItemTerrainFollow.qml
@@ -1,12 +1,12 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
ColumnLayout {
spacing: _margin
diff --git a/src/PlanView/TransectStyleMapVisuals.qml b/src/PlanView/TransectStyleMapVisuals.qml
index eb646c058..73ab9f024 100644
--- a/src/PlanView/TransectStyleMapVisuals.qml
+++ b/src/PlanView/TransectStyleMapVisuals.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
/// Base control for both Survey and Corridor Scan map visuals
Item {
diff --git a/src/PlanView/VTOLLandingPatternEditor.qml b/src/PlanView/VTOLLandingPatternEditor.qml
index 264278496..80b54f9cc 100644
--- a/src/PlanView/VTOLLandingPatternEditor.qml
+++ b/src/PlanView/VTOLLandingPatternEditor.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
// Editor for Fixed Wing Landing Pattern complex mission item
Rectangle {
diff --git a/src/PlanView/VTOLLandingPatternMapVisual.qml b/src/PlanView/VTOLLandingPatternMapVisual.qml
index 109bf0e76..5fbb83634 100644
--- a/src/PlanView/VTOLLandingPatternMapVisual.qml
+++ b/src/PlanView/VTOLLandingPatternMapVisual.qml
@@ -7,17 +7,17 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FlightMap
Item {
id: _root
@@ -161,7 +161,7 @@ Item {
readonly property int _decimalPlaces: 8
- onClicked: {
+ onClicked: (mouse) => {
var coordinate = map.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)
coordinate.latitude = coordinate.latitude.toFixed(_decimalPlaces)
coordinate.longitude = coordinate.longitude.toFixed(_decimalPlaces)
diff --git a/src/PositionManager/PositionManager.cpp b/src/PositionManager/PositionManager.cpp
index 78fbd8f67..c66853413 100644
--- a/src/PositionManager/PositionManager.cpp
+++ b/src/PositionManager/PositionManager.cpp
@@ -45,15 +45,15 @@ void QGCPositionManager::setToolbox(QGCToolbox *toolbox)
if (!_defaultSource) {
//-- Otherwise, create a default one
-#if 0
+#if 1
// Calling this can end up falling through a path which tries to instantiate a serialnmea source.
// The Qt code for this will pop a qWarning if there are no serial ports available. This in turn
// causes you to be unable to run with QT_FATAL_WARNINGS=1 to debug stuff.
_defaultSource = QGeoPositionInfoSource::createDefaultSource(this);
#else
// So instead we create our own version of QGeoPositionInfoSource::createDefaultSource which isn't as stupid.
- QList plugins = QGeoPositionInfoSourcePrivate::pluginsSorted();
- foreach (const QJsonObject &obj, plugins) {
+ QList plugins = QGeoPositionInfoSourcePrivate::pluginsSorted();
+ foreach (const auto &obj, plugins) {
if (obj.value("Position").isBool() && obj.value("Position").toBool()) {
QString pluginName = obj.value("Keys").toArray()[0].toString();
if (pluginName == "serialnmea") {
@@ -190,8 +190,8 @@ void QGCPositionManager::setPositionSource(QGCPositionManager::QGCPositionSource
_updateInterval = _currentSource->minimumUpdateInterval();
_currentSource->setPreferredPositioningMethods(QGeoPositionInfoSource::SatellitePositioningMethods);
_currentSource->setUpdateInterval(_updateInterval);
- connect(_currentSource, &QGeoPositionInfoSource::positionUpdated, this, &QGCPositionManager::_positionUpdated);
- connect(_currentSource, SIGNAL(error(QGeoPositionInfoSource::Error)), this, SLOT(_error(QGeoPositionInfoSource::Error)));
+ connect(_currentSource, &QGeoPositionInfoSource::positionUpdated, this, &QGCPositionManager::_positionUpdated);
+ connect(_currentSource, &QGeoPositionInfoSource::errorOccurred, this, &QGCPositionManager::_error);
_currentSource->startUpdates();
}
}
diff --git a/src/PositionManager/SimulatedPosition.cc b/src/PositionManager/SimulatedPosition.cc
index e9408d460..3ff6e0dd9 100644
--- a/src/PositionManager/SimulatedPosition.cc
+++ b/src/PositionManager/SimulatedPosition.cc
@@ -55,7 +55,7 @@ void SimulatedPosition::stopUpdates(void)
void SimulatedPosition::requestUpdate(int /*timeout*/)
{
- emit updateTimeout();
+ emit errorOccurred(QGeoPositionInfoSource::UpdateTimeoutError);
}
void SimulatedPosition::_updatePosition(void)
diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc
index 77c8b8325..789f384d4 100644
--- a/src/QGCApplication.cc
+++ b/src/QGCApplication.cc
@@ -406,7 +406,7 @@ void QGCApplication::setLanguage()
_app->removeTranslator(&_qgcTranslatorQtLibs);
if (_locale.name() != "en_US") {
QLocale::setDefault(_locale);
- if(_qgcTranslatorQtLibs.load("qt_" + _locale.name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
+ if(_qgcTranslatorQtLibs.load("qt_" + _locale.name(), QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
_app->installTranslator(&_qgcTranslatorQtLibs);
} else {
qCWarning(LocalizationLog) << "Qt lib localization for" << _locale.name() << "is not present";
diff --git a/src/QGCCachedFileDownload.cc b/src/QGCCachedFileDownload.cc
index 2dc1c63ff..c9a8de321 100644
--- a/src/QGCCachedFileDownload.cc
+++ b/src/QGCCachedFileDownload.cc
@@ -35,12 +35,12 @@ bool QGCCachedFileDownload::download(const QString& url, int maxCacheAgeSec)
bool expired = creationTime.addSecs(maxCacheAgeSec) < QDateTime::currentDateTime();
if (expired) {
// Force network download, as Qt would still use the cache otherwise (w/o checking the remote)
- auto attributes = QVector{qMakePair(QNetworkRequest::CacheLoadControlAttribute, QVariant{QNetworkRequest::AlwaysNetwork})};
+ auto attributes = QVector>{qMakePair(QNetworkRequest::CacheLoadControlAttribute, QVariant{QNetworkRequest::AlwaysNetwork})};
_downloadFromNetwork = true;
return _fileDownload->download(url, attributes);
}
- auto attributes = QVector{qMakePair(QNetworkRequest::CacheLoadControlAttribute, QVariant{QNetworkRequest::PreferCache})};
+ auto attributes = QVector>{qMakePair(QNetworkRequest::CacheLoadControlAttribute, QVariant{QNetworkRequest::PreferCache})};
return _fileDownload->download(url, attributes);
} else {
diff --git a/src/QGCLoggingCategory.h b/src/QGCLoggingCategory.h
index e4d1de3bc..3a413bfd8 100644
--- a/src/QGCLoggingCategory.h
+++ b/src/QGCLoggingCategory.h
@@ -11,6 +11,7 @@
#include
#include
+#include
// Add Global logging categories (not class specific) here using Q_DECLARE_LOGGING_CATEGORY
Q_DECLARE_LOGGING_CATEGORY(FirmwareUpgradeLog)
diff --git a/src/QGCToolbox.cc b/src/QGCToolbox.cc
index 7fede0138..8be03d3c1 100644
--- a/src/QGCToolbox.cc
+++ b/src/QGCToolbox.cc
@@ -45,10 +45,25 @@
#include CUSTOMHEADER
#endif
+ /**
+ * @brief Helper function to register a type with QML that is not creatable from QML
+ * @param uri The URI to register the type under
+ * @param majorVersion The major version of the type
+ * @param minorVersion The minor version of the type
+ * @param qmlName The name of the type in QML
+ */
+ template
+ void registerUncreatableQmlType(const char *uri, int majorVersion, int minorVersion, const char *qmlName)
+ {
+ qmlRegisterUncreatableType(uri, majorVersion, minorVersion, qmlName, "Reference only");
+ }
+
QGCToolbox::QGCToolbox(QGCApplication* app)
{
// SettingsManager must be first so settings are available to any subsequent tools
_settingsManager = new SettingsManager (app, this);
+ registerUncreatableQmlType("QGroundControl.SettingsManager", 1, 0, "SettingsManager");
+
//-- Scan and load plugins
_scanAndLoadPlugins(app);
_audioOutput = new AudioOutput (app, this);
@@ -64,10 +79,13 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
_missionCommandTree = new MissionCommandTree (app, this);
_multiVehicleManager = new MultiVehicleManager (app, this);
_mapEngineManager = new QGCMapEngineManager (app, this);
+ registerUncreatableQmlType("QGroundControl.QGCMapEngineManager", 1, 0, "QGCMapEngineManager");
_uasMessageHandler = new UASMessageHandler (app, this);
_qgcPositionManager = new QGCPositionManager (app, this);
_followMe = new FollowMe (app, this);
_videoManager = new VideoManager (app, this);
+ registerUncreatableQmlType("QGroundControl.VideoManager", 1, 0, "VideoManager");
+
_mavlinkLogManager = new MAVLinkLogManager (app, this);
_adsbVehicleManager = new ADSBVehicleManager (app, this);
#if defined(QGC_ENABLE_PAIRING)
diff --git a/src/QmlControls/APMSubMotorDisplay.qml b/src/QmlControls/APMSubMotorDisplay.qml
index 767ed80de..20eb44622 100644
--- a/src/QmlControls/APMSubMotorDisplay.qml
+++ b/src/QmlControls/APMSubMotorDisplay.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
+import QtQuick
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
Item {
id: root
diff --git a/src/QmlControls/AltModeDialog.qml b/src/QmlControls/AltModeDialog.qml
index 079457f49..5af341342 100644
--- a/src/QmlControls/AltModeDialog.qml
+++ b/src/QmlControls/AltModeDialog.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 2.12
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
QGCPopupDialog {
title: qsTr("Select Altitude Mode")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
property var rgRemoveModes
property var updateAltModeFn
diff --git a/src/QmlControls/AppMessages.cc b/src/QmlControls/AppMessages.cc
index 853c73f58..c0508adb7 100644
--- a/src/QmlControls/AppMessages.cc
+++ b/src/QmlControls/AppMessages.cc
@@ -68,7 +68,7 @@ void AppLogModel::writeMessages(const QString dest_file)
{
const QString writebuffer(stringList().join('\n').append('\n'));
- QtConcurrent::run([dest_file, writebuffer] {
+ QFuture future = QtConcurrent::run([dest_file, writebuffer] {
emit debug_model->writeStarted();
bool success = false;
QFile file(dest_file);
diff --git a/src/QmlControls/AppMessages.qml b/src/QmlControls/AppMessages.qml
index 76f6199e9..c97b52231 100644
--- a/src/QmlControls/AppMessages.qml
+++ b/src/QmlControls/AppMessages.qml
@@ -7,19 +7,19 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.12
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
Item {
id: _root
@@ -85,9 +85,8 @@ Item {
id: writeDialog
folder: QGroundControl.settingsManager.appSettings.logSavePath
nameFilters: [qsTr("Log files (*.txt)"), qsTr("All Files (*)")]
- selectExisting: false
title: qsTr("Select log save file")
- onAcceptedForSave: {
+ onAcceptedForSave: (file) => {
debugMessageModel.writeMessages(file);
visible = false;
}
@@ -157,7 +156,7 @@ Item {
QGCPopupDialog {
title: qsTr("Logging categories")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
ColumnLayout {
RowLayout {
diff --git a/src/QmlControls/AutotuneUI.qml b/src/QmlControls/AutotuneUI.qml
index 39613a845..181161165 100644
--- a/src/QmlControls/AutotuneUI.qml
+++ b/src/QmlControls/AutotuneUI.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controllers
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
Item {
id: _root
@@ -34,7 +34,7 @@ Item {
Rectangle {
width: _root.width
height: statusColumn.height + (2 * _margins)
- color: palette.windowShade
+ color: qgcPal.windowShade
enabled: _autotune.autotuneEnabled
QGCButton {
@@ -56,7 +56,7 @@ Item {
\n2. The current control gains are good enough to stabilize the drone in presence of medium disturbances \
\n3. You are ready to abort the auto-tuning sequence by moving the RC sticks, if anything unexpected happens. \
\n\nClick Ok to start the auto-tuning process.\n"),
- StandardButton.Ok | StandardButton.Cancel,
+ Dialog.Ok | Dialog.Cancel,
function() { _autotune.autotuneRequest() })
}
diff --git a/src/QmlControls/AxisMonitor.qml b/src/QmlControls/AxisMonitor.qml
index ec4cb7b1a..6b4cb2b14 100644
--- a/src/QmlControls/AxisMonitor.qml
+++ b/src/QmlControls/AxisMonitor.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
Item {
property int axisValue: 0
diff --git a/src/QmlControls/ClickableColor.qml b/src/QmlControls/ClickableColor.qml
index 69686b9ab..3b01adcf9 100644
--- a/src/QmlControls/ClickableColor.qml
+++ b/src/QmlControls/ClickableColor.qml
@@ -1,6 +1,6 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
Rectangle {
id: _root
diff --git a/src/QmlControls/DeadMouseArea.qml b/src/QmlControls/DeadMouseArea.qml
index 39db1ec18..d3115fef4 100644
--- a/src/QmlControls/DeadMouseArea.qml
+++ b/src/QmlControls/DeadMouseArea.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
MouseArea {
preventStealing:true
hoverEnabled: true
- onWheel: { wheel.accepted = true; }
- onPressed: { mouse.accepted = true; }
- onReleased: { mouse.accepted = true; }
+ onWheel: (wheel) => (wheel) => { wheel.accepted = true; }
+ onPressed: (mouse) => { mouse.accepted = true; }
+ onReleased: (mouse) => { mouse.accepted = true; }
}
diff --git a/src/QmlControls/DropButton.qml b/src/QmlControls/DropButton.qml
index d987b9b2e..d88146420 100644
--- a/src/QmlControls/DropButton.qml
+++ b/src/QmlControls/DropButton.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
Item {
id: _root
@@ -41,14 +41,14 @@ Item {
property real _viewportMaxTop: -y + viewportMargins + topMargin
property real _viewportMaxBottom: parent.height - (viewportMargins * 2) - y
- // Set up ExclusiveGroup support. We use the checked property to drive visibility of drop down.
+ // Set up ButtonGroup support. We use the checked property to drive visibility of drop down.
property alias checked: roundButton.checked
- property ExclusiveGroup exclusiveGroup: null
- onExclusiveGroupChanged: {
- if (exclusiveGroup) {
- exclusiveGroup.bindCheckable(_root)
+ property ButtonGroup buttonGroup: null
+ onButtonGroupChanged: {
+ if (buttonGroup) {
+ buttonGroup.addButton(_root)
}
}
@@ -158,7 +158,7 @@ Item {
}
}
- RoundButton {
+ QGCRoundButton {
id: roundButton
radius: parent.width / 2
onClicked: {
diff --git a/src/QmlControls/DropPanel.qml b/src/QmlControls/DropPanel.qml
index 068fe5567..faf9921fb 100644
--- a/src/QmlControls/DropPanel.qml
+++ b/src/QmlControls/DropPanel.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
Item {
id: _root
diff --git a/src/QmlControls/EditPositionDialog.qml b/src/QmlControls/EditPositionDialog.qml
index 16f3623d6..61ca9bab8 100644
--- a/src/QmlControls/EditPositionDialog.qml
+++ b/src/QmlControls/EditPositionDialog.qml
@@ -7,22 +7,22 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
QGCPopupDialog {
id: root
title: qsTr("Edit Position")
- buttons: mainWindow.showDialogDefaultWidth, StandardButton.Close
+ buttons: mainWindow.showDialogDefaultWidth, Dialog.Close
property alias coordinate: controller.coordinate
diff --git a/src/QmlControls/ExclusiveGroupItem.qml b/src/QmlControls/ExclusiveGroupItem.qml
index 0e89b8cf4..a512c4686 100644
--- a/src/QmlControls/ExclusiveGroupItem.qml
+++ b/src/QmlControls/ExclusiveGroupItem.qml
@@ -1,18 +1,18 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
/// The ExclusiveGroupItem control can be used as a base class for a control which
-/// needs support for ExclusiveGroup
+/// needs support for ButtonGroup
Item {
id: _root
property bool checked: false
- property ExclusiveGroup exclusiveGroup: null
+ property ButtonGroup buttonGroup: null
- onExclusiveGroupChanged: {
- if (exclusiveGroup) {
- exclusiveGroup.bindCheckable(_root)
+ onButtonGroupChanged: {
+ if (buttonGroup) {
+ buttonGroup.bindCheckable(_root)
}
}
}
diff --git a/src/QmlControls/FactSliderPanel.qml b/src/QmlControls/FactSliderPanel.qml
index 610b0566f..763dc79a3 100644
--- a/src/QmlControls/FactSliderPanel.qml
+++ b/src/QmlControls/FactSliderPanel.qml
@@ -8,16 +8,16 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
Column {
/// ListModel must contains elements which look like this:
@@ -40,7 +40,7 @@ Column {
id: controller
}
- QGCPalette { id: palette; colorGroupEnabled: enabled }
+ QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
Column {
id: sliderOuterColumn
@@ -57,7 +57,7 @@ Column {
anchors.left: parent.left
anchors.right: parent.right
height: sliderColumn.y + sliderColumn.height + _margins
- color: palette.windowShade
+ color: qgcPal.windowShade
Column {
id: sliderColumn
@@ -78,10 +78,10 @@ Column {
Slider {
anchors.left: parent.left
anchors.right: parent.right
- minimumValue: min
- maximumValue: max
+ from: min
+ to: max
stepSize: step
- tickmarksEnabled: true
+ //tickmarksEnabled: true // FIXME_QT6
value: _fact.value
id: slider
property int handleWidth: 0
@@ -94,6 +94,8 @@ Column {
}
}
+ // FIXME-QT6 - Controls 2 doesn't do styling this way
+ /*
style: SliderStyle {
tickmarks: Repeater {
id: repeater
@@ -105,7 +107,7 @@ Column {
}
Rectangle {
- color: Qt.hsla(palette.text.hslHue, palette.text.hslSaturation, palette.text.hslLightness, 0.5)
+ color: Qt.hsla(qgcPal.text.hslHue, qgcPal.text.hslSaturation, qgcPal.text.hslLightness, 0.5)
width: 2
height: 4
y: repeater.height
@@ -113,6 +115,7 @@ Column {
}
}
}
+ */
}
Item { // spacing
diff --git a/src/QmlControls/FileButton.qml b/src/QmlControls/FileButton.qml
index 1ebd67eba..3389d7ee9 100644
--- a/src/QmlControls/FileButton.qml
+++ b/src/QmlControls/FileButton.qml
@@ -1,8 +1,8 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
/// File Button controls used by QGCFileDialog control
Rectangle {
diff --git a/src/QmlControls/FlightModeDropdown.qml b/src/QmlControls/FlightModeDropdown.qml
index 7f40b20c3..675babdd4 100644
--- a/src/QmlControls/FlightModeDropdown.qml
+++ b/src/QmlControls/FlightModeDropdown.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
Item {
width: flightModeLabel.visible ? flightModeLabel.width : flightModeCombo.width
diff --git a/src/QmlControls/FlightModeMenu.qml b/src/QmlControls/FlightModeMenu.qml
index 4c0464e27..e14596452 100644
--- a/src/QmlControls/FlightModeMenu.qml
+++ b/src/QmlControls/FlightModeMenu.qml
@@ -7,12 +7,12 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.12
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
// Label control whichs pop up a flight mode change menu when clicked
QGCLabel {
diff --git a/src/QmlControls/HackAndroidFileDialog.qml b/src/QmlControls/HackAndroidFileDialog.qml
index f6c3ec909..3759cd40c 100644
--- a/src/QmlControls/HackAndroidFileDialog.qml
+++ b/src/QmlControls/HackAndroidFileDialog.qml
@@ -1,5 +1,5 @@
-import QtQuick 2.3
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Dialogs
// 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
@@ -9,7 +9,6 @@ Item {
property var folder
property var nameFilters
property var title
- property var selectExisting
property var selectMultiple
property var selectFolder
diff --git a/src/QmlControls/HeightIndicator.qml b/src/QmlControls/HeightIndicator.qml
index 32531f1cf..7ffd06c5e 100644
--- a/src/QmlControls/HeightIndicator.qml
+++ b/src/QmlControls/HeightIndicator.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
ColumnLayout {
id: _root
diff --git a/src/QmlControls/HorizontalFactValueGrid.qml b/src/QmlControls/HorizontalFactValueGrid.qml
index 93b825c18..c94cb6821 100644
--- a/src/QmlControls/HorizontalFactValueGrid.qml
+++ b/src/QmlControls/HorizontalFactValueGrid.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.2
-import QtQuick.Controls 2.5
-import QtQml 2.12
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
+import QtQml
-import QGroundControl.Templates 1.0 as T
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl 1.0
+import QGroundControl.Templates as T
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
+import QGroundControl.Palette
+import QGroundControl.FlightMap
+import QGroundControl
T.HorizontalFactValueGrid {
id: _root
@@ -172,7 +172,7 @@ T.HorizontalFactValueGrid {
property var mappedLabelValueColumnLayoutPosition: _root.mapFromItem(labelValueColumnLayout, labelValueColumnLayout.x, labelValueColumnLayout.y)
- onClicked: {
+ onClicked: (mouse) => {
var columnGridLayoutItem = labelValueColumnLayout.childAt(mouse.x, mouse.y)
//console.log(mouse.x, mouse.y, columnGridLayoutItem)
var mappedMouse = labelValueColumnLayout.mapToItem(columnGridLayoutItem, mouse.x, mouse.y)
diff --git a/src/QmlControls/IndicatorButton.qml b/src/QmlControls/IndicatorButton.qml
index 1e6cc9617..9a02cbf11 100644
--- a/src/QmlControls/IndicatorButton.qml
+++ b/src/QmlControls/IndicatorButton.qml
@@ -7,12 +7,12 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
/// Works just like a regular button but it can have a red indicator on the right side displayed
QGCButton {
diff --git a/src/QmlControls/InstrumentValueArea.qml b/src/QmlControls/InstrumentValueArea.qml
index a29b23d1a..18948bae7 100644
--- a/src/QmlControls/InstrumentValueArea.qml
+++ b/src/QmlControls/InstrumentValueArea.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.2
-import QtQuick.Controls 2.5
-import QtQml 2.12
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
+import QtQml
-import QGroundControl.Templates 1.0 as T
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl 1.0
+import QGroundControl.Templates as T
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
+import QGroundControl.Palette
+import QGroundControl.FlightMap
+import QGroundControl
T.InstrumentValueArea {
id: _root
diff --git a/src/QmlControls/InstrumentValueData.h b/src/QmlControls/InstrumentValueData.h
index 81436617f..6d84ea64a 100644
--- a/src/QmlControls/InstrumentValueData.h
+++ b/src/QmlControls/InstrumentValueData.h
@@ -12,11 +12,10 @@
#include "FactSystem.h"
#include "QmlObjectListModel.h"
#include "QGCApplication.h"
+#include "FactValueGrid.h"
#include
-class FactValueGrid;
-
class InstrumentValueData : public QObject
{
Q_OBJECT
diff --git a/src/QmlControls/InstrumentValueEditDialog.qml b/src/QmlControls/InstrumentValueEditDialog.qml
index 7d45d9f3e..5d9e2b3b9 100644
--- a/src/QmlControls/InstrumentValueEditDialog.qml
+++ b/src/QmlControls/InstrumentValueEditDialog.qml
@@ -7,28 +7,28 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.2
-import QtQuick.Controls 2.5
+import QtQuick
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controllers
+import QGroundControl.Palette
QGCPopupDialog {
id: root
title: qsTr("Value Display")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
property var instrumentValueData
- QGCPalette { id: qgcPal; colorGroupEnabled: parent.enabled }
- QGCPalette { id: qgcPalDisabled; colorGroupEnabled: false }
+ QGCPalette { id: qgcPal; colorGroupEnabled: parent.enabled }
+ QGCPalette { id: qgcPalDisable; colorGroupEnabled: false }
Loader {
sourceComponent: instrumentValueData.fact ? editorComponent : noFactComponent
@@ -106,7 +106,7 @@ QGCPopupDialog {
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
- color: enabled ? qgcPal.text : qgcPalDisabled.text
+ color: enabled ? qgcPal.text : qgcPalDisable.text
enabled: iconRadio.checked
MouseArea {
@@ -237,7 +237,7 @@ QGCPopupDialog {
ColorDialog {
id: colorPickerDialog
modality: Qt.ApplicationModal
- currentColor: instrumentValueData.rangeColors.length ? instrumentValueData.rangeColors[colorIndex] : "white"
+ selectedColor: instrumentValueData.rangeColors.length ? instrumentValueData.rangeColors[colorIndex] : "white"
onAccepted: updateColorValue(colorIndex, color)
property int colorIndex: 0
@@ -520,7 +520,7 @@ QGCPopupDialog {
QGCPopupDialog {
title: qsTr("Select Icon")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
property var iconNames
property string icon
diff --git a/src/QmlControls/InstrumentValueLabel.qml b/src/QmlControls/InstrumentValueLabel.qml
index 99e09c780..e53adcb17 100644
--- a/src/QmlControls/InstrumentValueLabel.qml
+++ b/src/QmlControls/InstrumentValueLabel.qml
@@ -7,20 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.2
-import QtQuick.Controls 2.5
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Templates 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
ColumnLayout {
- property var instrumentValueData: null
+ property var instrumentValueData: null
- property bool _verticalOrientation: instrumentValueData.factValueGrid.orientation === FactValueGrid.VerticalOrientation
property var _rgFontSizes: [ ScreenTools.defaultFontPointSize, ScreenTools.smallFontPointSize, ScreenTools.mediumFontPointSize, ScreenTools.largeFontPointSize ]
property var _rgFontSizeRatios: [ 1, ScreenTools.smallFontPointRatio, ScreenTools.mediumFontPointRatio, ScreenTools.largeFontPointRatio ]
property real _doubleDescent: ScreenTools.defaultFontDescent * 2
@@ -34,7 +32,7 @@ ColumnLayout {
QGCColoredImage {
id: valueIcon
- Layout.alignment: _verticalOrientation ? Qt.AlignHCenter : Qt.AlignVCenter
+ Layout.alignment: Qt.AlignVCenter
height: _tightHeight * 0.75
width: _tightHeight * 0.85
sourceSize.height: height
@@ -45,7 +43,6 @@ ColumnLayout {
opacity: instrumentValueData.currentOpacity
visible: _iconVisible
-
readonly property string iconPrefix: "/InstrumentValueIcons/"
function updateIcon() {
@@ -65,16 +62,10 @@ ColumnLayout {
function onIconChanged() { valueIcon.updateIcon() }
}
Component.onCompleted: updateIcon();
-
- Rectangle {
- anchors.fill: valueIcon
- color: qgcPal.text
- visible: valueIcon.status === Image.Error
- }
}
QGCLabel {
- Layout.alignment: _verticalOrientation ? Qt.AlignHCenter : Qt.AlignVCenter
+ Layout.alignment: Qt.AlignVCenter
height: _tightHeight
font.pointSize: ScreenTools.smallFontPointSize
text: instrumentValueData.text
diff --git a/src/QmlControls/InstrumentValueValue.qml b/src/QmlControls/InstrumentValueValue.qml
index 7b2a3302d..0647348fd 100644
--- a/src/QmlControls/InstrumentValueValue.qml
+++ b/src/QmlControls/InstrumentValueValue.qml
@@ -7,16 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.2
-import QtQuick.Controls 2.5
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Templates 1.0
-import QGroundControl.Templates 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
ColumnLayout {
property var instrumentValueData: null
diff --git a/src/QmlControls/JoystickThumbPad.qml b/src/QmlControls/JoystickThumbPad.qml
index ae9ec8050..6ecf2feee 100644
--- a/src/QmlControls/JoystickThumbPad.qml
+++ b/src/QmlControls/JoystickThumbPad.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.12
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Item {
id: _joyRoot
diff --git a/src/QmlControls/KMLOrSHPFileDialog.qml b/src/QmlControls/KMLOrSHPFileDialog.qml
index a7b3e9711..97e136097 100644
--- a/src/QmlControls/KMLOrSHPFileDialog.qml
+++ b/src/QmlControls/KMLOrSHPFileDialog.qml
@@ -7,16 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ShapeFileHelper 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ShapeFileHelper
QGCFileDialog {
id: kmlOrSHPLoadDialog
folder: QGroundControl.settingsManager.appSettings.missionSavePath
title: qsTr("Select Polygon File")
- selectExisting: true
nameFilters: ShapeFileHelper.fileDialogKMLOrSHPFilters
}
diff --git a/src/QmlControls/LogReplayStatusBar.qml b/src/QmlControls/LogReplayStatusBar.qml
index 7bc3bfd4c..d6feb9589 100644
--- a/src/QmlControls/LogReplayStatusBar.qml
+++ b/src/QmlControls/LogReplayStatusBar.qml
@@ -1,11 +1,11 @@
-import QtQuick 2.3
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Rectangle {
height: visible ? (rowLayout.height + (_margins * 2)) : 0
@@ -29,9 +29,8 @@ Rectangle {
id: filePicker
title: qsTr("Select Telemetery Log")
nameFilters: [ qsTr("Telemetry Logs (*.%1)").arg(_logFileExtension), qsTr("All Files (*)") ]
- selectExisting: true
folder: QGroundControl.settingsManager.appSettings.telemetrySavePath
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
controller.link = QGroundControl.linkManager.startLogReplay(file)
close()
}
diff --git a/src/QmlControls/MAVLinkChart.qml b/src/QmlControls/MAVLinkChart.qml
index ed1bacb74..2eb23ce63 100644
--- a/src/QmlControls/MAVLinkChart.qml
+++ b/src/QmlControls/MAVLinkChart.qml
@@ -1,13 +1,13 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
-import QtCharts 2.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtCharts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
ChartView {
id: chartView
diff --git a/src/QmlControls/MAVLinkMessageButton.qml b/src/QmlControls/MAVLinkMessageButton.qml
index 190e9c2d5..1d3c7bd63 100644
--- a/src/QmlControls/MAVLinkMessageButton.qml
+++ b/src/QmlControls/MAVLinkMessageButton.qml
@@ -7,12 +7,12 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Button {
id: control
diff --git a/src/QmlControls/MainWindowSavedState.qml b/src/QmlControls/MainWindowSavedState.qml
index 519daa6f0..ef5c9be69 100644
--- a/src/QmlControls/MainWindowSavedState.qml
+++ b/src/QmlControls/MainWindowSavedState.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Window 2.11
-import QtQuick.Controls 2.4
-import Qt.labs.settings 1.0
+import QtQuick
+import QtQuick.Window
+import QtQuick.Controls
+import QtCore
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
Item {
property Window window
diff --git a/src/QmlControls/MissionCommandDialog.qml b/src/QmlControls/MissionCommandDialog.qml
index a13e7a08c..30a9cefec 100644
--- a/src/QmlControls/MissionCommandDialog.qml
+++ b/src/QmlControls/MissionCommandDialog.qml
@@ -8,20 +8,20 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
QGCPopupDialog {
id: root
title: qsTr("Select Mission Command")
- buttons: StandardButton.Cancel
+ buttons: Dialog.Cancel
property var vehicle
property var missionItem
diff --git a/src/QmlControls/MissionItemIndexLabel.qml b/src/QmlControls/MissionItemIndexLabel.qml
index 52305cf98..b9a21ef56 100644
--- a/src/QmlControls/MissionItemIndexLabel.qml
+++ b/src/QmlControls/MissionItemIndexLabel.qml
@@ -1,8 +1,8 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
Canvas {
id: root
diff --git a/src/QmlControls/ModeSwitchDisplay.qml b/src/QmlControls/ModeSwitchDisplay.qml
index ac3226df0..cf3f37fbe 100644
--- a/src/QmlControls/ModeSwitchDisplay.qml
+++ b/src/QmlControls/ModeSwitchDisplay.qml
@@ -8,12 +8,12 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Rectangle {
property string flightModeName ///< User visible name for this flight mode
diff --git a/src/QmlControls/MultiRotorMotorDisplay.qml b/src/QmlControls/MultiRotorMotorDisplay.qml
index 647aa1d7e..cb3ae58dc 100644
--- a/src/QmlControls/MultiRotorMotorDisplay.qml
+++ b/src/QmlControls/MultiRotorMotorDisplay.qml
@@ -1,7 +1,7 @@
-import QtQuick 2.3
+import QtQuick
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Item {
id: motorRoot
diff --git a/src/QmlControls/OfflineMapButton.qml b/src/QmlControls/OfflineMapButton.qml
index 82d58d0ad..efbb98ddd 100644
--- a/src/QmlControls/OfflineMapButton.qml
+++ b/src/QmlControls/OfflineMapButton.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Button {
id: mapButton
diff --git a/src/QmlControls/PIDTuning.qml b/src/QmlControls/PIDTuning.qml
index 891cfe939..b129068ac 100644
--- a/src/QmlControls/PIDTuning.qml
+++ b/src/QmlControls/PIDTuning.qml
@@ -7,17 +7,17 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtCharts 2.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtCharts
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Vehicle
RowLayout {
layoutDirection: Qt.RightToLeft
@@ -306,20 +306,20 @@ RowLayout {
property var _startPoint: undefined
property double _scaling: 0
anchors.fill: parent
- onPressed: {
+ onPressed: (mouse) => {
_startPoint = Qt.point(mouse.x, mouse.y)
var start = chart.mapToValue(_startPoint)
var next = chart.mapToValue(Qt.point(mouse.x+1, mouse.y+1))
_scaling = next.x - start.x
}
- onWheel: {
+ onWheel: (wheel) => {
if (wheel.angleDelta.y > 0)
chartDisplaySec /= 1.2
else
chartDisplaySec *= 1.2
_xAxis.min = _xAxis.max - chartDisplaySec
}
- onPositionChanged: {
+ onPositionChanged: (mouse) => {
if(_startPoint != undefined) {
dataTimer.running = false
var cp = Qt.point(mouse.x, mouse.y)
diff --git a/src/QmlControls/ParameterDiffDialog.qml b/src/QmlControls/ParameterDiffDialog.qml
index 136ee0388..962de8cc5 100644
--- a/src/QmlControls/ParameterDiffDialog.qml
+++ b/src/QmlControls/ParameterDiffDialog.qml
@@ -7,21 +7,21 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.2
-import QtQuick.Controls 2.5
-import QtQuick.Dialogs 1.3
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controllers
QGCPopupDialog {
title: qsTr("Load Parameters")
- buttons: StandardButton.Cancel | (paramController.diffList.count ? StandardButton.Ok : 0)
+ buttons: Dialog.Cancel | (paramController.diffList.count ? Dialog.Ok : 0)
property var paramController
diff --git a/src/QmlControls/ParameterEditor.qml b/src/QmlControls/ParameterEditor.qml
index 2f00f9a3c..12fbfcd1e 100644
--- a/src/QmlControls/ParameterEditor.qml
+++ b/src/QmlControls/ParameterEditor.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
Item {
id: _root
@@ -37,8 +37,6 @@ Item {
id: controller
}
- ExclusiveGroup { id: sectionGroup }
-
//---------------------------------------------
//-- Header
Row {
@@ -109,7 +107,7 @@ Item {
text: qsTr("Reset all to firmware's defaults")
onTriggered: mainWindow.showMessageDialog(qsTr("Reset All"),
qsTr("Select Reset to reset all parameters to their defaults.\n\nNote that this will also completely reset everything, including UAVCAN nodes, all vehicle settings, setup and calibrations."),
- StandardButton.Cancel | StandardButton.Reset,
+ Dialog.Cancel | Dialog.Reset,
function() { controller.resetAllToDefaults() })
}
QGCMenuItem {
@@ -117,7 +115,7 @@ Item {
visible: !_activeVehicle.apmFirmware
onTriggered: mainWindow.showMessageDialog(qsTr("Reset All"),
qsTr("Select Reset to reset all parameters to the vehicle's configuration defaults."),
- StandardButton.Cancel | StandardButton.Reset,
+ Dialog.Cancel | Dialog.Reset,
function() { controller.resetAllToVehicleConfiguration() })
}
QGCMenuSeparator { }
@@ -125,7 +123,6 @@ Item {
text: qsTr("Load from file...")
onTriggered: {
fileDialog.title = qsTr("Load Parameters")
- fileDialog.selectExisting = true
fileDialog.openForLoad()
}
}
@@ -133,7 +130,6 @@ Item {
text: qsTr("Save to file...")
onTriggered: {
fileDialog.title = qsTr("Save Parameters")
- fileDialog.selectExisting = false
fileDialog.openForSave()
}
}
@@ -148,7 +144,7 @@ Item {
text: qsTr("Reboot Vehicle")
onTriggered: mainWindow.showMessageDialog(qsTr("Reboot Vehicle"),
qsTr("Select Ok to reboot vehicle."),
- StandardButton.Cancel | StandardButton.Ok,
+ Dialog.Cancel | Dialog.Ok,
function() { _activeVehicle.rebootVehicle() })
}
}
@@ -185,7 +181,6 @@ Item {
anchors.right: parent.right
text: object.name
checked: object == controller.currentCategory
- exclusiveGroup: sectionGroup
onCheckedChanged: {
if (checked) {
@@ -302,12 +297,12 @@ Item {
folder: _appSettings.parameterSavePath
nameFilters: [ qsTr("Parameter Files (*.%1)").arg(_appSettings.parameterFileExtension) , qsTr("All Files (*)") ]
- onAcceptedForSave: {
+ onAcceptedForSave: (file) => {
controller.saveToFile(file)
close()
}
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
close()
if (controller.buildDiffFromFile(file)) {
parameterDiffDialog.createObject(mainWindow).open()
diff --git a/src/QmlControls/ParameterEditorDialog.qml b/src/QmlControls/ParameterEditorDialog.qml
index f0bdf7049..dae11f3d2 100644
--- a/src/QmlControls/ParameterEditorDialog.qml
+++ b/src/QmlControls/ParameterEditorDialog.qml
@@ -7,23 +7,23 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 2.15
-import QtQuick.Layouts 1.15
-import QtQuick.Dialogs 1.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Controllers
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
QGCPopupDialog {
id: root
title: qsTr("Parameter Editor")
- buttons: StandardButton.Cancel | StandardButton.Save
+ buttons: Dialog.Cancel | Dialog.Save
property Fact fact
property bool showRCToParam: false
diff --git a/src/QmlControls/PreFlightCheckButton.qml b/src/QmlControls/PreFlightCheckButton.qml
index 2380275b0..3334432ac 100644
--- a/src/QmlControls/PreFlightCheckButton.qml
+++ b/src/QmlControls/PreFlightCheckButton.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
/// The PreFlightCheckButton supports creating a button which the user then has to verify/click to confirm a check.
/// It also supports failing the check based on values from within the system: telemetry or QGC app values. These
diff --git a/src/QmlControls/PreFlightCheckGroup.qml b/src/QmlControls/PreFlightCheckGroup.qml
index 0e0713218..4f9ce1d6d 100644
--- a/src/QmlControls/PreFlightCheckGroup.qml
+++ b/src/QmlControls/PreFlightCheckGroup.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQml.Models 2.1
+import QtQuick
+import QtQml.Models
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
/// A PreFlightCheckGroup manages a set of PreFlightCheckButtons as a single entity.
Column {
diff --git a/src/QmlControls/PreFlightCheckList.qml b/src/QmlControls/PreFlightCheckList.qml
index 692ce3396..94a32f804 100644
--- a/src/QmlControls/PreFlightCheckList.qml
+++ b/src/QmlControls/PreFlightCheckList.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQml.Models 2.1
+import QtQuick
+import QtQuick.Controls
+import QtQml.Models
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
Rectangle {
width: mainColumn.width + 3*ScreenTools.defaultFontPixelWidth
diff --git a/src/QmlControls/PreFlightCheckModel.qml b/src/QmlControls/PreFlightCheckModel.qml
index c38afe35f..7fe844b94 100644
--- a/src/QmlControls/PreFlightCheckModel.qml
+++ b/src/QmlControls/PreFlightCheckModel.qml
@@ -7,8 +7,8 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQml.Models 2.1
+import QtQuick
+import QtQml.Models
ObjectModel {
id: _root
diff --git a/src/QmlControls/QGCButton.qml b/src/QmlControls/QGCButton.qml
index 6570bd423..4b3a490df 100644
--- a/src/QmlControls/QGCButton.qml
+++ b/src/QmlControls/QGCButton.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.3
-import QtQuick.Controls 2.12
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Button {
id: control
diff --git a/src/QmlControls/QGCCheckBox.qml b/src/QmlControls/QGCCheckBox.qml
index 9a8e6943d..a02903bec 100644
--- a/src/QmlControls/QGCCheckBox.qml
+++ b/src/QmlControls/QGCCheckBox.qml
@@ -1,11 +1,15 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
CheckBox {
+ id: control
+ spacing: _noText ? 0 : ScreenTools.defaultFontPixelWidth
+ focusPolicy: Qt.ClickFocus
+
property color textColor: _qgcPal.text
property bool textBold: false
property real textFontPointSize: ScreenTools.defaultFontPointSize
@@ -13,48 +17,48 @@ CheckBox {
property var _qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool _noText: text === ""
- activeFocusOnPress: true
-
- style: CheckBoxStyle {
- spacing: _noText ? 0 : ScreenTools.defaultFontPixelWidth * 0.25
-
- label: Item {
- implicitWidth: _noText ? 0 : text.implicitWidth + ScreenTools.defaultFontPixelWidth * 0.25
- implicitHeight: _noText ? 0 : Math.max(text.implicitHeight, ScreenTools.checkBoxIndicatorSize)
- baselineOffset: text.baselineOffset
-
- Text {
- id: text
- text: control.text
- font.pointSize: textFontPointSize
- font.bold: control.textBold
- font.family: ScreenTools.normalFontFamily
- color: control.textColor
- anchors.centerIn: parent
- }
- }
-
- indicator: Item {
- implicitWidth: ScreenTools.checkBoxIndicatorSize
- implicitHeight: implicitWidth
- Rectangle {
- anchors.fill: parent
- color: control.enabled ? "white" : _qgcPal.text
- border.color: _qgcPal.text
- border.width: 1
- opacity: control.checkedState === Qt.PartiallyChecked ? 0.5 : 1
- QGCColoredImage {
- source: "/qmlimages/checkbox-check.svg"
- color: "black"
- opacity: control.checkedState === Qt.Checked ? (control.enabled ? 1 : 0.5) : 0
- mipmap: true
- fillMode: Image.PreserveAspectFit
- width: parent.width * 0.75
- height: width
- sourceSize.height: height
- anchors.centerIn: parent
- }
- }
+ property ButtonGroup buttonGroup: null
+ onButtonGroupChanged: {
+ if (buttonGroup) {
+ buttonGroup.addButton(control)
}
}
+
+ contentItem: Text {
+ //implicitWidth: _noText ? 0 : text.implicitWidth + ScreenTools.defaultFontPixelWidth * 0.25
+ //implicitHeight: _noText ? 0 : Math.max(text.implicitHeight, ScreenTools.checkBoxIndicatorSize)
+ leftPadding: control.indicator.width + control.spacing
+ verticalAlignment: Text.AlignVCenter
+ text: control.text
+ font.pointSize: textFontPointSize
+ font.bold: control.textBold
+ font.family: ScreenTools.normalFontFamily
+ color: control.textColor
+ }
+
+ /*
+ // FIXME-QT6: Temporarily disabled, using standard Qt for now
+ indicator: Rectangle {
+ implicitWidth: ScreenTools.checkBoxIndicatorSize
+ implicitHeight: implicitWidth
+ x: control.leftPadding
+ y: parent.height / 2 - height / 2
+ color: control.enabled ? "white" : _qgcPal.text
+ border.color: _qgcPal.text
+ border.width: 1
+ opacity: control.checkedState === Qt.PartiallyChecked ? 0.5 : 1
+
+ QGCColoredImage {
+ source: "/qmlimages/checkbox-check.svg"
+ color: "black"
+ opacity: control.checkedState === Qt.Checked ? (control.enabled ? 1 : 0.5) : 0
+ mipmap: true
+ fillMode: Image.PreserveAspectFit
+ width: parent.width * 0.75
+ height: width
+ sourceSize.height: height
+ anchors.centerIn: parent
+ }
+ }
+ */
}
diff --git a/src/QmlControls/QGCColoredImage.qml b/src/QmlControls/QGCColoredImage.qml
index a6639f6a0..2b6f2d69f 100644
--- a/src/QmlControls/QGCColoredImage.qml
+++ b/src/QmlControls/QGCColoredImage.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import Qt5Compat.GraphicalEffects
-import QGroundControl.Palette 1.0
+import QGroundControl.Palette
Item {
property color color: "white" // Image color
@@ -16,7 +16,6 @@ Item {
property alias paintedHeight: image.paintedHeight
property alias paintedWidth: image.paintedWidth
property alias progress: image.progress
- property alias smooth: image.smooth
property alias mipmap: image.mipmap
property alias source: image.source
property alias sourceSize: image.sourceSize
diff --git a/src/QmlControls/QGCColumnButton.qml b/src/QmlControls/QGCColumnButton.qml
index 02721fb17..b326f0020 100644
--- a/src/QmlControls/QGCColumnButton.qml
+++ b/src/QmlControls/QGCColumnButton.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.5
-import QtQuick.Controls 2.12
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
QGCButton {
id: control //This is a button rework from DonLakeFlyer's QGCButton that allows to contain a text and an Icon with a column look and the same capabilites
diff --git a/src/QmlControls/QGCComboBox.qml b/src/QmlControls/QGCComboBox.qml
index b51b3f91d..e2715c722 100644
--- a/src/QmlControls/QGCComboBox.qml
+++ b/src/QmlControls/QGCComboBox.qml
@@ -7,15 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Window 2.3
-import QtQuick.Controls 2.4
-import QtQuick.Controls.impl 2.4
-import QtQuick.Templates 2.4 as T
+import QtQuick
+import QtQuick.Window
+import QtQuick.Controls
+import QtQuick.Templates as T
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
T.ComboBox {
id: control
@@ -155,7 +154,7 @@ T.ComboBox {
}
background: Rectangle {
- color: control.palette.window
+ color: _qgcPal.window
}
}
}
diff --git a/src/QmlControls/QGCControlDebug.qml b/src/QmlControls/QGCControlDebug.qml
index 8ba76d665..84ed12317 100644
--- a/src/QmlControls/QGCControlDebug.qml
+++ b/src/QmlControls/QGCControlDebug.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QtQuick 2.12
+import QtQuick
Rectangle {
id: _root
diff --git a/src/QmlControls/QGCDynamicObjectManager.qml b/src/QmlControls/QGCDynamicObjectManager.qml
index e29bd3462..f5eff4413 100644
--- a/src/QmlControls/QGCDynamicObjectManager.qml
+++ b/src/QmlControls/QGCDynamicObjectManager.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
/// Provides a standard set of tools for dynamically create/adding/removing Qml objects
Item {
diff --git a/src/QmlControls/QGCFileDialog.qml b/src/QmlControls/QGCFileDialog.qml
index a4c185e44..96112ffdc 100644
--- a/src/QmlControls/QGCFileDialog.qml
+++ b/src/QmlControls/QGCFileDialog.qml
@@ -1,12 +1,13 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import Qt.labs.platform as Labs
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controllers
/// This control is meant to be a direct replacement for the standard Qml FileDialog control.
/// It differs for mobile builds which uses a completely custom file picker.
@@ -17,8 +18,8 @@ Item {
property string folder // Due to Qt bug with file url parsing this must be an absolute path
property var nameFilters: [] // Important: Only name filters with simple wildcarding like *.foo are supported.
property string title
- property bool selectExisting: true
property bool selectFolder: false
+ property string defaultSuffix: ""
signal acceptedForLoad(string file)
signal acceptedForSave(string file)
@@ -28,7 +29,10 @@ Item {
_openForLoad = true
if (_mobileDlg && folder.length !== 0) {
mobileFileOpenDialogComponent.createObject(mainWindow).open()
+ } else if (selectFolder) {
+ fullFolderDialog.open()
} else {
+ fullFileDialog.fileMode = FileDialog.OpenFile
fullFileDialog.open()
}
}
@@ -38,6 +42,7 @@ Item {
if (_mobileDlg && folder.length !== 0) {
mobileFileSaveDialogComponent.createObject(mainWindow).open()
} else {
+ fullFileDialog.fileMode = FileDialog.SaveFile
fullFileDialog.open()
}
}
@@ -89,30 +94,37 @@ Item {
FileDialog {
id: fullFileDialog
- folder: "file:///" + _root.folder
+ currentFolder: "file:///" + _root.folder
nameFilters: _root.nameFilters ? _root.nameFilters : []
title: _root.title
- selectExisting: _root.selectExisting
- selectMultiple: false
- selectFolder: _root.selectFolder
+ defaultSuffix: _root.defaultSuffix
onAccepted: {
- if (_openForLoad) {
- _root.acceptedForLoad(controller.urlToLocalFile(fileUrl))
+ if (fileMode == FileDialog.OpenFile) {
+ _root.acceptedForLoad(controller.urlToLocalFile(selectedFile))
} else {
- _root.acceptedForSave(controller.urlToLocalFile(fileUrl))
+ _root.acceptedForSave(controller.urlToLocalFile(selectedFile))
}
}
onRejected: _root.rejected()
}
+ Labs.FolderDialog {
+ id: fullFolderDialog
+ currentFolder: "file:///" + _root.folder
+ title: _root.title
+
+ onAccepted: _root.acceptedForLoad(controller.urlToLocalFile(folder))
+ onRejected: _root.rejected()
+ }
+
Component {
id: mobileFileOpenDialogComponent
QGCPopupDialog {
id: mobileFileOpenDialog
title: _root.title
- buttons: StandardButton.Cancel
+ buttons: Dialog.Cancel
Column {
id: fileOpenColumn
@@ -174,7 +186,7 @@ Item {
QGCPopupDialog {
id: mobileFileSaveDialog
title: _root.title
- buttons: StandardButton.Cancel | StandardButton.Ok
+ buttons: Dialog.Cancel | Dialog.Ok
onAccepted: {
if (filenameTextField.text == "") {
diff --git a/src/QmlControls/QGCFlickable.qml b/src/QmlControls/QGCFlickable.qml
index 8bf130eee..540448733 100644
--- a/src/QmlControls/QGCFlickable.qml
+++ b/src/QmlControls/QGCFlickable.qml
@@ -1,7 +1,7 @@
-import QtQuick 2.3
+import QtQuick
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
/// QGC version of Flickable control that shows horizontal/vertial scroll indicators
Flickable {
diff --git a/src/QmlControls/QGCFlickableHorizontalIndicator.qml b/src/QmlControls/QGCFlickableHorizontalIndicator.qml
index 5400e1001..05046f382 100644
--- a/src/QmlControls/QGCFlickableHorizontalIndicator.qml
+++ b/src/QmlControls/QGCFlickableHorizontalIndicator.qml
@@ -1,4 +1,4 @@
-import QtQuick 2.3
+import QtQuick
Rectangle {
id: horizontalIndicator
diff --git a/src/QmlControls/QGCFlickableVerticalIndicator.qml b/src/QmlControls/QGCFlickableVerticalIndicator.qml
index f50a2b004..997fafc9f 100644
--- a/src/QmlControls/QGCFlickableVerticalIndicator.qml
+++ b/src/QmlControls/QGCFlickableVerticalIndicator.qml
@@ -1,4 +1,4 @@
-import QtQuick 2.3
+import QtQuick
Rectangle {
id: verticalIndicator
diff --git a/src/QmlControls/QGCGroupBox.qml b/src/QmlControls/QGCGroupBox.qml
index e77e61301..8b7d8fb76 100644
--- a/src/QmlControls/QGCGroupBox.qml
+++ b/src/QmlControls/QGCGroupBox.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 2.0
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
GroupBox {
id: control
diff --git a/src/QmlControls/QGCLabel.qml b/src/QmlControls/QGCLabel.qml
index 3364dd7b7..1bc8a46d5 100644
--- a/src/QmlControls/QGCLabel.qml
+++ b/src/QmlControls/QGCLabel.qml
@@ -1,8 +1,8 @@
-import QtQuick 2.12
-import QtQuick.Controls 2.12
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Text {
font.pointSize: ScreenTools.defaultFontPointSize
diff --git a/src/QmlControls/QGCListView.qml b/src/QmlControls/QGCListView.qml
index 104bb3cba..a52f29b31 100644
--- a/src/QmlControls/QGCListView.qml
+++ b/src/QmlControls/QGCListView.qml
@@ -1,6 +1,6 @@
-import QtQuick 2.3
+import QtQuick
-import QGroundControl.Palette 1.0
+import QGroundControl.Palette
/// QGC version of ListVIew control that shows horizontal/vertial scroll indicators
ListView {
diff --git a/src/QmlControls/QGCMapLabel.qml b/src/QmlControls/QGCMapLabel.qml
index 2d5639f55..d66165cb4 100644
--- a/src/QmlControls/QGCMapLabel.qml
+++ b/src/QmlControls/QGCMapLabel.qml
@@ -1,8 +1,8 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.Controls
+import QGroundControl.Palette
/// Text control used for displaying text of Maps
QGCLabel {
diff --git a/src/QmlControls/QGCMenu.qml b/src/QmlControls/QGCMenu.qml
index 03d6f454f..3bc434ff6 100644
--- a/src/QmlControls/QGCMenu.qml
+++ b/src/QmlControls/QGCMenu.qml
@@ -1,7 +1,5 @@
-// Use old QtQuick.Control 1.x Menu to work around bug in new Qml Menu
-
-import QtQuick 2.6
-import QtQuick.Controls 1.4
+import QtQuick
+import QtQuick.Controls
Menu {
diff --git a/src/QmlControls/QGCMenuItem.qml b/src/QmlControls/QGCMenuItem.qml
index 2415b9085..21fa310d6 100644
--- a/src/QmlControls/QGCMenuItem.qml
+++ b/src/QmlControls/QGCMenuItem.qml
@@ -1,7 +1,5 @@
-// QtQuick.Control 1.x Menu
-
-import QtQuick 2.6
-import QtQuick.Controls 1.4
+import QtQuick
+import QtQuick.Controls
MenuItem {
diff --git a/src/QmlControls/QGCMenuSeparator.qml b/src/QmlControls/QGCMenuSeparator.qml
index a8c872375..64b86b036 100644
--- a/src/QmlControls/QGCMenuSeparator.qml
+++ b/src/QmlControls/QGCMenuSeparator.qml
@@ -1,7 +1,5 @@
-// QtQuick.Control 1.x Menu
-
-import QtQuick 2.6
-import QtQuick.Controls 1.4
+import QtQuick
+import QtQuick.Controls
MenuSeparator {
diff --git a/src/QmlControls/QGCMouseArea.qml b/src/QmlControls/QGCMouseArea.qml
index 9218c5df0..44b5bf276 100644
--- a/src/QmlControls/QGCMouseArea.qml
+++ b/src/QmlControls/QGCMouseArea.qml
@@ -1,7 +1,7 @@
-import QtQuick 2.11
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
/// Works just like a regular MouseArea except:
/// 1) It supports the ability to show touch extents based on QGroundControl.showTouchAreas
diff --git a/src/QmlControls/QGCMovableItem.qml b/src/QmlControls/QGCMovableItem.qml
index 3f2b2f9e9..5c3f41f4c 100644
--- a/src/QmlControls/QGCMovableItem.qml
+++ b/src/QmlControls/QGCMovableItem.qml
@@ -1,6 +1,6 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QGroundControl.ScreenTools 1.0
+import QtQuick
+import QtQuick.Controls
+import QGroundControl.ScreenTools
// This item can be dragged around within its parent.
// Double click issues a signal the parent can use to
@@ -28,14 +28,14 @@ Item {
drag.maximumX: root.parent.width - (root.width * tform.xScale)
drag.maximumY: root.parent.height - (root.height * tform.yScale)
drag.filterChildren: true
- onPressed: {
+ onPressed: (mouse) => {
root.anchors.left = undefined
root.anchors.right = undefined
}
onDoubleClicked: {
root.resetRequested();
}
- onWheel:
+ onWheel: (wheel) =>
{
var zoomFactor = 1;
if(wheel.angleDelta.y > 0)
diff --git a/src/QmlControls/QGCOptionsComboBox.qml b/src/QmlControls/QGCOptionsComboBox.qml
index 732d311ba..593641d33 100644
--- a/src/QmlControls/QGCOptionsComboBox.qml
+++ b/src/QmlControls/QGCOptionsComboBox.qml
@@ -9,13 +9,13 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
ComboBox {
id: control
diff --git a/src/QmlControls/QGCPipOverlay.qml b/src/QmlControls/QGCPipOverlay.qml
index c8eaaa509..88a97b0bb 100644
--- a/src/QmlControls/QGCPipOverlay.qml
+++ b/src/QmlControls/QGCPipOverlay.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Window 2.12
+import QtQuick
+import QtQuick.Window
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Controls
+import QGroundControl.Palette
Item {
id: _root
@@ -133,7 +133,7 @@ Item {
property real initialWidth: 0
// When we push the mouse button down, we un-anchor the mouse area to prevent a resizing loop
- onPressed: {
+ onPressed: (mouse) => {
pipResize.anchors.top = undefined // Top doesn't seem to 'detach'
pipResize.anchors.right = undefined // This one works right, which is what we really need
pipResize.initialX = mouse.x
diff --git a/src/QmlControls/QGCPipState.qml b/src/QmlControls/QGCPipState.qml
index c143ec18f..e63101b42 100644
--- a/src/QmlControls/QGCPipState.qml
+++ b/src/QmlControls/QGCPipState.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QtQuick 2.12
+import QtQuick
// Used to manage state for itesm using with QGCPipOveral
Item {
diff --git a/src/QmlControls/QGCPopupDialog.qml b/src/QmlControls/QGCPopupDialog.qml
index 51235f5e7..f5e7eb3ff 100644
--- a/src/QmlControls/QGCPopupDialog.qml
+++ b/src/QmlControls/QGCPopupDialog.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.12
-import QtQuick.Dialogs 1.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
// Provides the standard dialog mechanism for QGC. Works 99% like Qml Dialog.
//
@@ -50,7 +50,7 @@ Popup {
focus: true
property string title
- property var buttons: StandardButton.Ok
+ property var buttons: Dialog.Ok
property bool acceptAllowed: acceptButton.visible
property bool rejectAllowed: rejectButton.visible
property alias acceptButtonEnabled: acceptButton.enabled
@@ -155,58 +155,58 @@ Popup {
acceptButton.visible = false
rejectButton.visible = false
// Accept role buttons
- if (buttons & StandardButton.Ok) {
+ if (buttons & Dialog.Ok) {
acceptButton.text = qsTr("Ok")
acceptButton.visible = true
- } else if (buttons & StandardButton.Open) {
+ } else if (buttons & Dialog.Open) {
acceptButton.text = qsTr("Open")
acceptButton.visible = true
- } else if (buttons & StandardButton.Save) {
+ } else if (buttons & Dialog.Save) {
acceptButton.text = qsTr("Save")
acceptButton.visible = true
- } else if (buttons & StandardButton.Apply) {
+ } else if (buttons & Dialog.Apply) {
acceptButton.text = qsTr("Apply")
acceptButton.visible = true
- } else if (buttons & StandardButton.Open) {
+ } else if (buttons & Dialog.Open) {
acceptButton.text = qsTr("Open")
acceptButton.visible = true
- } else if (buttons & StandardButton.SaveAll) {
+ } else if (buttons & Dialog.SaveAll) {
acceptButton.text = qsTr("Save All")
acceptButton.visible = true
- } else if (buttons & StandardButton.Yes) {
+ } else if (buttons & Dialog.Yes) {
acceptButton.text = qsTr("Yes")
acceptButton.visible = true
- } else if (buttons & StandardButton.YesToAll) {
+ } else if (buttons & Dialog.YesToAll) {
acceptButton.text = qsTr("Yes to All")
acceptButton.visible = true
- } else if (buttons & StandardButton.Retry) {
+ } else if (buttons & Dialog.Retry) {
acceptButton.text = qsTr("Retry")
acceptButton.visible = true
- } else if (buttons & StandardButton.Reset) {
+ } else if (buttons & Dialog.Reset) {
acceptButton.text = qsTr("Reset")
acceptButton.visible = true
- } else if (buttons & StandardButton.RestoreToDefaults) {
+ } else if (buttons & Dialog.RestoreToDefaults) {
acceptButton.text = qsTr("Restore to Defaults")
acceptButton.visible = true
- } else if (buttons & StandardButton.Ignore) {
+ } else if (buttons & Dialog.Ignore) {
acceptButton.text = qsTr("Ignore")
acceptButton.visible = true
}
// Reject role buttons
- if (buttons & StandardButton.Cancel) {
+ if (buttons & Dialog.Cancel) {
rejectButton.text = qsTr("Cancel")
rejectButton.visible = true
- } else if (buttons & StandardButton.Close) {
+ } else if (buttons & Dialog.Close) {
rejectButton.text = qsTr("Close")
rejectButton.visible = true
- } else if (buttons & StandardButton.No) {
+ } else if (buttons & Dialog.No) {
rejectButton.text = qsTr("No")
rejectButton.visible = true
- } else if (buttons & StandardButton.NoToAll) {
+ } else if (buttons & Dialog.NoToAll) {
rejectButton.text = qsTr("No to All")
rejectButton.visible = true
- } else if (buttons & StandardButton.Abort) {
+ } else if (buttons & Dialog.Abort) {
rejectButton.text = qsTr("Abort")
rejectButton.visible = true
}
@@ -275,7 +275,7 @@ Popup {
height: childrenRect.height
focus: true
- Keys.onReleased: {
+ Keys.onReleased: (event) => {
if (event.key === Qt.Key_Escape) {
_reject()
event.accepted = true
diff --git a/src/QmlControls/QGCRadioButton.qml b/src/QmlControls/QGCRadioButton.qml
index daa48fff7..96aadc3c6 100644
--- a/src/QmlControls/QGCRadioButton.qml
+++ b/src/QmlControls/QGCRadioButton.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
RadioButton {
id: control
diff --git a/src/QmlControls/RoundButton.qml b/src/QmlControls/QGCRoundButton.qml
similarity index 84%
rename from src/QmlControls/RoundButton.qml
rename to src/QmlControls/QGCRoundButton.qml
index dc58856dd..14cb21098 100644
--- a/src/QmlControls/RoundButton.qml
+++ b/src/QmlControls/QGCRoundButton.qml
@@ -1,9 +1,9 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
Item {
id: _root
@@ -18,13 +18,13 @@ Item {
height: radius * 2
property bool checked: false
- property ExclusiveGroup exclusiveGroup: null
+ property ButtonGroup buttonGroup: null
QGCPalette { id: qgcPal }
- onExclusiveGroupChanged: {
- if (exclusiveGroup) {
- exclusiveGroup.bindCheckable(_root)
+ onButtonGroupChanged: {
+ if (buttonGroup) {
+ buttonGroup.addButton(_root)
}
}
diff --git a/src/QmlControls/QGCSimpleMessageDialog.qml b/src/QmlControls/QGCSimpleMessageDialog.qml
index 460dc3281..255488205 100644
--- a/src/QmlControls/QGCSimpleMessageDialog.qml
+++ b/src/QmlControls/QGCSimpleMessageDialog.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.15
-import QtQuick.Layouts 1.15
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
QGCPopupDialog {
property alias text: label.text
diff --git a/src/QmlControls/QGCSlider.qml b/src/QmlControls/QGCSlider.qml
index 7a4196483..019b4be51 100644
--- a/src/QmlControls/QGCSlider.qml
+++ b/src/QmlControls/QGCSlider.qml
@@ -7,78 +7,97 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Controls.Private 1.0
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Slider {
- id: _root
+ id: control
implicitHeight: ScreenTools.implicitSliderHeight
+ leftPadding: 0
+ rightPadding: 0
+ topPadding: 0
+ bottomPadding: 0
- // Value indicator starts display from zero instead of min value
- property bool zeroCentered: false
- property bool displayValue: false
- property bool indicatorBarVisible: true
+ // FIXME-QT6 - This property used to be available in Control 1. Now we will need to implement the visuals ourselves
+ property bool tickmarksEnabled: false
- style: SliderStyle {
- groove: Item {
- anchors.verticalCenter: parent.verticalCenter
- implicitWidth: Math.round(ScreenTools.defaultFontPixelHeight * 4.5)
- implicitHeight: Math.round(ScreenTools.defaultFontPixelHeight * 0.3)
+
+ property bool zeroCentered: false // Value indicator starts display from zero instead of min value
+ property bool displayValue: false
+ property bool indicatorBarVisible: true
+
+ property real _implicitBarLength: Math.round(ScreenTools.defaultFontPixelWidth * 20)
+ property real _barHeight: Math.round(ScreenTools.defaultFontPixelHeight / 3)
+
+ background: Rectangle {
+ x: control.horizontal ?
+ control.leftPadding :
+ control.leftPadding + control.availableWidth / 2 - width / 2
+ y: control.horizontal ?
+ control.topPadding + control.availableHeight / 2 - height / 2 :
+ control.topPadding
+ implicitWidth: control.horizontal ? control._implicitBarLength : control._barHeight
+ implicitHeight: control.horizontal ? control._barHeight : control._implicitBarLength
+ width: control.horizontal ? control.availableWidth : implicitWidth
+ height: control.horizontal ? implicitHeight : control.availableHeight
+ radius: control._barHeight / 2
+ color: qgcPal.button
+ border.width: 1
+ border.color: qgcPal.buttonText
+ }
+
+ // FIXME-QT6: Indicator portion of slider not yet supported
+/*
+ Item {
+ id: indicatorBar
+ clip: true
+ visible: indicatorBarVisible
+ x: control.zeroCentered ? zeroCenteredIndicatorStart : 0
+ width: control.zeroCentered ? centerIndicatorWidth : control.visualPosition
+ height: parent.height
+
+ property real zeroValuePosition: (Math.abs(control.minimumValue) / (control.maximumValue - control.minimumValue)) * parent.width
+ property real zeroCenteredIndicatorStart: Math.min(control.visualPosition, zeroValuePosition)
+ property real zeroCenteredIndicatorStop: Math.max(control.visualPosition, zeroValuePosition)
+ property real centerIndicatorWidth: zeroCenteredIndicatorStop - zeroCenteredIndicatorStart
Rectangle {
- radius: height / 2
anchors.fill: parent
- color: qgcPal.button
- border.width: 1
- border.color: qgcPal.buttonText
- }
-
- Item {
- id: indicatorBar
- clip: true
- visible: indicatorBarVisible
- x: _root.zeroCentered ? zeroCenteredIndicatorStart : 0
- width: _root.zeroCentered ? centerIndicatorWidth : styleData.handlePosition
- height: parent.height
-
- property real zeroValuePosition: (Math.abs(control.minimumValue) / (control.maximumValue - control.minimumValue)) * parent.width
- property real zeroCenteredIndicatorStart: Math.min(styleData.handlePosition, zeroValuePosition)
- property real zeroCenteredIndicatorStop: Math.max(styleData.handlePosition, zeroValuePosition)
- property real centerIndicatorWidth: zeroCenteredIndicatorStop - zeroCenteredIndicatorStart
-
- Rectangle {
- anchors.fill: parent
- color: qgcPal.colorBlue
- border.color: Qt.darker(color, 1.2)
- radius: height/2
- }
+ color: qgcPal.colorBlue
+ border.color: Qt.darker(color, 1.2)
+ radius: height/2
}
}
+ }*/
- handle: Rectangle {
- anchors.centerIn: parent
- color: qgcPal.button
- border.color: qgcPal.buttonText
- border.width: 1
- implicitWidth: _radius * 2
- implicitHeight: _radius * 2
- radius: _radius
+ handle: Rectangle {
+ x: control.horizontal ?
+ control.leftPadding + control.visualPosition * (control.availableWidth - width) :
+ control.leftPadding + control.availableWidth / 2 - width / 2
+ y: control.horizontal ?
+ control.topPadding + control.availableHeight / 2 - height / 2 :
+ control.topPadding + control.visualPosition * (control.availableHeight - height)
+ implicitWidth: _radius * 2
+ implicitHeight: _radius * 2
+ color: qgcPal.button
+ border.color: qgcPal.buttonText
+ border.width: 1
+ radius: _radius
- property real _radius: Math.round(_root.implicitHeight / 2)
+ property real _radius: ScreenTools.defaultFontPixelHeight / 2
- Label {
- text: _root.value.toFixed( _root.maximumValue <= 1 ? 1 : 0)
- visible: _root.displayValue
- anchors.centerIn: parent
- font.family: ScreenTools.normalFontFamily
- font.pointSize: ScreenTools.smallFontPointSize
- color: qgcPal.buttonText
- }
+ Label {
+ text: control.value.toFixed( control.maximumValue <= 1 ? 1 : 0)
+ visible: control.displayValue
+ anchors.centerIn: parent
+ font.family: ScreenTools.normalFontFamily
+ font.pointSize: ScreenTools.smallFontPointSize
+ color: qgcPal.buttonText
}
}
}
diff --git a/src/QmlControls/QGCSwitch.qml b/src/QmlControls/QGCSwitch.qml
index d7fd6f203..4df81fb26 100644
--- a/src/QmlControls/QGCSwitch.qml
+++ b/src/QmlControls/QGCSwitch.qml
@@ -7,24 +7,22 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Switch {
id: _root
QGCPalette { id:qgcPal; colorGroupEnabled: true }
- style: SwitchStyle {
- groove: Rectangle {
- implicitWidth: ScreenTools.defaultFontPixelWidth * 6
- implicitHeight: ScreenTools.defaultFontPixelHeight
- color: (control.checked && control.enabled) ? qgcPal.colorGreen : qgcPal.colorGrey
- radius: 3
- border.color: qgcPal.button
- border.width: 1
- }
+ indicator: Rectangle {
+ implicitWidth: ScreenTools.defaultFontPixelWidth * 6
+ implicitHeight: ScreenTools.defaultFontPixelHeight
+ color: (control.checked && control.enabled) ? qgcPal.colorGreen : qgcPal.colorGrey
+ radius: 3
+ border.color: qgcPal.button
+ border.width: 1
}
}
diff --git a/src/QmlControls/QGCTabBar.qml b/src/QmlControls/QGCTabBar.qml
index e7189fbfc..96743e5d3 100644
--- a/src/QmlControls/QGCTabBar.qml
+++ b/src/QmlControls/QGCTabBar.qml
@@ -1,10 +1,10 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
TabBar {
background: Rectangle {
diff --git a/src/QmlControls/QGCTabButton.qml b/src/QmlControls/QGCTabButton.qml
index ab3be6715..4df086b08 100644
--- a/src/QmlControls/QGCTabButton.qml
+++ b/src/QmlControls/QGCTabButton.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.12
-import QtQuick.Controls.impl 2.12
-import QtQuick.Templates 2.12 as T
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Templates as T
import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0
@@ -50,7 +50,7 @@ T.TabButton {
background: Rectangle {
implicitHeight: 40
color: checked ? qgcPal.buttonHighlight : qgcPal.button
- /*color: Color.blend(control.checked ? control.palette.window : control.palette.dark,
- control.palette.mid, control.down ? 0.5 : 0.0)*/
+ /*color: Color.blend(control.checked ? control.qgcPal.window : control.qgcPal.dark,
+ control.qgcPal.mid, control.down ? 0.5 : 0.0)*/
}
}
diff --git a/src/QmlControls/QGCTextField.qml b/src/QmlControls/QGCTextField.qml
index 89934a177..b5cb5e5ba 100644
--- a/src/QmlControls/QGCTextField.qml
+++ b/src/QmlControls/QGCTextField.qml
@@ -1,30 +1,38 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
TextField {
- id: root
- textColor: qgcPal.textFieldText
+ id: control
+ color: qgcPal.textFieldText
implicitHeight: ScreenTools.implicitTextFieldHeight
activeFocusOnPress: true
antialiasing: true
+ font.pointSize: ScreenTools.defaultFontPointSize
+ font.family: ScreenTools.normalFontFamily
inputMethodHints: numericValuesOnly && !ScreenTools.isiOS ?
Qt.ImhFormattedNumbersOnly: // Forces use of virtual numeric keyboard instead of full keyboard
Qt.ImhNone // iOS numeric keyboard has no done button, we can't use it.
+ leftPadding: _marginPadding
+ rightPadding: _marginPadding + unitsHelpLayout.width
+ topPadding: _marginPadding
+ bottomPadding: _marginPadding
property bool showUnits: false
property bool showHelp: false
property string unitsLabel: ""
property string extraUnitsLabel: ""
property bool numericValuesOnly: false // true: Used as hint for mobile devices to show numeric only keyboard
-
- signal helpClicked
+ property alias textColor: control.color
property real _helpLayoutWidth: 0
+ property real _marginPadding: ScreenTools.defaultFontPixelHeight / 3
+
+ signal helpClicked
Component.onCompleted: selectAllIfActiveFocus()
onActiveFocusChanged: selectAllIfActiveFocus()
@@ -44,95 +52,75 @@ TextField {
}
}
- QGCLabel {
- id: unitsLabelWidthGenerator
- text: unitsLabel
- width: contentWidth + parent.__contentHeight * 0.666
- visible: false
- antialiasing: true
- }
+ background: Rectangle {
+ border.width: 1
+ border.color: control.activeFocus ? "#47b" : "#999"
+ color: qgcPal.textField
+ implicitHeight: ScreenTools.implicitTextFieldHeight
- style: TextFieldStyle {
- id: tfs
- font.pointSize: ScreenTools.defaultFontPointSize
- font.family: ScreenTools.normalFontFamily
- renderType: ScreenTools.isWindows ? Text.QtRendering : tfs.renderType // This works around font rendering problems on windows
+ RowLayout {
+ id: unitsHelpLayout
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ anchors.rightMargin: control.activeFocus ? 2 : control._marginPadding
+ spacing: ScreenTools.defaultFontPixelWidth / 4
+ layoutDirection: Qt.RightToLeft
- background: Item {
- id: backgroundItem
-
- property bool showHelp: control.showHelp && control.activeFocus
+ Component.onCompleted: control._helpLayoutWidth = unitsHelpLayout.width
+ onWidthChanged: control._helpLayoutWidth = unitsHelpLayout.width
+ // Help button
Rectangle {
- anchors.fill: parent
- anchors.bottomMargin: -1
- color: "#44ffffff"
- }
+ id: helpButton
+ Layout.margins: 2
+ Layout.leftMargin: 0
+ Layout.rightMargin: 1
+ Layout.fillHeight: true
+ Layout.preferredWidth: helpLabel.contentWidth * 3
+ Layout.alignment: Qt.AlignVCenter
+ color: control.color
+ visible: control.showHelp && control.activeFocus
- Rectangle {
- anchors.fill: parent
- border.width: enabled ? 1 : 0
- border.color: root.activeFocus ? "#47b" : "#999"
- color: qgcPal.textField
- }
-
- RowLayout {
- id: unitsHelpLayout
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.rightMargin: backgroundItem.showHelp ? 0 : control.__contentHeight * 0.333
- anchors.right: parent.right
- spacing: ScreenTools.defaultFontPixelWidth / 4
-
- Component.onCompleted: control._helpLayoutWidth = unitsHelpLayout.width
- onWidthChanged: control._helpLayoutWidth = unitsHelpLayout.width
-
- Text {
- Layout.alignment: Qt.AlignVCenter
- text: control.unitsLabel
- font.pointSize: backgroundItem.showHelp ? ScreenTools.smallFontPointSize : ScreenTools.defaultFontPointSize
- font.family: ScreenTools.normalFontFamily
- antialiasing: true
- color: control.textColor
- visible: control.showUnits && text !== ""
+ QGCLabel {
+ id: helpLabel
+ anchors.centerIn: parent
+ color: qgcPal.textField
+ text: qsTr("?")
}
- Text {
- Layout.alignment: Qt.AlignVCenter
- text: control.extraUnitsLabel
- font.pointSize: ScreenTools.smallFontPointSize
- font.family: ScreenTools.normalFontFamily
- antialiasing: true
- color: control.textColor
- visible: control.showUnits && text !== ""
- }
-
- Rectangle {
- Layout.margins: 2
- Layout.leftMargin: 0
- Layout.rightMargin: 1
- Layout.fillHeight: true
- width: helpLabel.contentWidth * 3
- color: control.textColor
- visible: backgroundItem.showHelp
-
- QGCLabel {
- id: helpLabel
- anchors.centerIn: parent
- color: qgcPal.textField
- text: qsTr("?")
- }
- }
}
- MouseArea {
- anchors.margins: ScreenTools.isMobile ? -(ScreenTools.defaultFontPixelWidth * 0.66) : 0 // Larger touch area for mobile
- anchors.fill: unitsHelpLayout
- enabled: control.activeFocus
- onClicked: root.helpClicked()
+ // Extra units
+ Text {
+ Layout.alignment: Qt.AlignVCenter
+ text: control.extraUnitsLabel
+ font.pointSize: ScreenTools.smallFontPointSize
+ font.family: ScreenTools.normalFontFamily
+ antialiasing: true
+ color: control.color
+ visible: control.showUnits && text !== ""
+ }
+
+ // Units
+ Text {
+ Layout.alignment: Qt.AlignVCenter
+ text: control.unitsLabel
+ font.pointSize: control.activeFocus ? ScreenTools.smallFontPointSize : ScreenTools.defaultFontPointSize
+ font.family: ScreenTools.normalFontFamily
+ antialiasing: true
+ color: control.color
+ visible: control.showUnits && text !== ""
}
}
+ }
- padding.right: control._helpLayoutWidth //control.showUnits ? unitsLabelWidthGenerator.width : control.__contentHeight * 0.333
+ MouseArea {
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ width: control._helpLayoutWidth
+ enabled: helpButton.visible
+ onClicked: control.helpClicked()
}
}
diff --git a/src/QmlControls/QGCToolBarButton.qml b/src/QmlControls/QGCToolBarButton.qml
index c7903be1d..2cc9e1f73 100644
--- a/src/QmlControls/QGCToolBarButton.qml
+++ b/src/QmlControls/QGCToolBarButton.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
// Important Note: Toolbar buttons must manage their checked state manually in order to support
// view switch prevention. This means they can't be checkable or autoExclusive.
diff --git a/src/QmlControls/QGCToolInsets.qml b/src/QmlControls/QGCToolInsets.qml
index 3639a2a28..af06578fd 100644
--- a/src/QmlControls/QGCToolInsets.qml
+++ b/src/QmlControls/QGCToolInsets.qml
@@ -7,7 +7,7 @@
*
****************************************************************************/
-import QtQuick 2.12
+import QtQuick
QtObject {
property real leftEdgeCenterInset: 0
diff --git a/src/QmlControls/QGroundControl/Controls/qmldir b/src/QmlControls/QGroundControl/Controls/qmldir
index 0ac432def..59152b20e 100644
--- a/src/QmlControls/QGroundControl/Controls/qmldir
+++ b/src/QmlControls/QGroundControl/Controls/qmldir
@@ -94,7 +94,7 @@ RallyPointItemEditor 1.0 RallyPointItemEditor.qml
RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml
RCChannelMonitor 1.0 RCChannelMonitor.qml
RCToParamDialog 1.0 RCToParamDialog.qml
-RoundButton 1.0 RoundButton.qml
+QCRoundButton 1.0 QGCRoundButton.qml
SectionHeader 1.0 SectionHeader.qml
SetupPage 1.0 SetupPage.qml
SignalStrength 1.0 SignalStrength.qml
diff --git a/src/QmlControls/QGroundControlQmlGlobal.h b/src/QmlControls/QGroundControlQmlGlobal.h
index 1a54275ad..6a8ba466c 100644
--- a/src/QmlControls/QGroundControlQmlGlobal.h
+++ b/src/QmlControls/QGroundControlQmlGlobal.h
@@ -39,6 +39,20 @@ class MicrohardManager;
class QGCToolbox;
class LinkManager;
+#ifndef OPAQUE_PTR_QGFroundControlQmlGlobal
+ #define OPAQUE_PTR_QGFroundControlQmlGlobal
+ Q_DECLARE_OPAQUE_POINTER(LinkManager*)
+ Q_DECLARE_OPAQUE_POINTER(QGCMapEngineManager*)
+ Q_DECLARE_OPAQUE_POINTER(QGCPositionManager*)
+ Q_DECLARE_OPAQUE_POINTER(VideoManager*)
+ Q_DECLARE_OPAQUE_POINTER(MAVLinkLogManager*)
+ Q_DECLARE_OPAQUE_POINTER(SettingsManager*)
+ Q_DECLARE_OPAQUE_POINTER(QGCCorePlugin*)
+ Q_DECLARE_OPAQUE_POINTER(MissionCommandTree*)
+ Q_DECLARE_OPAQUE_POINTER(TaisyncManager*)
+ Q_DECLARE_OPAQUE_POINTER(MicrohardManager*)
+#endif
+
class QGroundControlQmlGlobal : public QGCTool
{
Q_OBJECT
diff --git a/src/QmlControls/QmlTest.qml b/src/QmlControls/QmlTest.qml
index c5d23f7af..117aab71f 100644
--- a/src/QmlControls/QmlTest.qml
+++ b/src/QmlControls/QmlTest.qml
@@ -1,11 +1,11 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
Rectangle {
id: _root
@@ -35,21 +35,21 @@ Rectangle {
function exportTheme() {
var themeObj = {"light": {}, "dark":{}}
- var oldTheme = palette.globalTheme;
+ var oldTheme = qgcPal.globalTheme;
- palette.globalTheme = QGCPalette.Light
- palette.colorGroupEnabled = true
+ qgcPal.globalTheme = QGCPalette.Light
+ qgcPal.colorGroupEnabled = true
themeObj.light["enabled"] = exportPaletteColors(palette);
- palette.colorGroupEnabled = false
+ qgcPal.colorGroupEnabled = false
themeObj.light["disabled"] = exportPaletteColors(palette);
- palette.globalTheme = QGCPalette.Dark
- palette.colorGroupEnabled = true
+ qgcPal.globalTheme = QGCPalette.Dark
+ qgcPal.colorGroupEnabled = true
themeObj.dark["enabled"] = exportPaletteColors(palette);
- palette.colorGroupEnabled = false
+ qgcPal.colorGroupEnabled = false
themeObj.dark["disabled"] = exportPaletteColors(palette);
- palette.globalTheme = oldTheme;
- palette.colorGroupEnabled = true;
+ qgcPal.globalTheme = oldTheme;
+ qgcPal.colorGroupEnabled = true;
var jsonString = JSON.stringify(themeObj, null, 4);
@@ -58,8 +58,8 @@ Rectangle {
function exportThemeCPP() {
var palToExport = ""
- for(var i = 0; i < palette.colors.length; i++) {
- var cs = palette.colors[i]
+ for(var i = 0; i < qgcPal.colors.length; i++) {
+ var cs = qgcPal.colors[i]
var csc = cs + 'Colors'
palToExport += 'DECLARE_QGC_COLOR(' + cs + ', \"' + palette[csc][1] + '\", \"' + palette[csc][0] + '\", \"' + palette[csc][3] + '\", \"' + palette[csc][2] + '\")\n'
}
@@ -68,8 +68,8 @@ Rectangle {
function exportThemePlugin() {
var palToExport = ""
- for(var i = 0; i < palette.colors.length; i++) {
- var cs = palette.colors[i]
+ for(var i = 0; i < qgcPal.colors.length; i++) {
+ var cs = qgcPal.colors[i]
var csc = cs + 'Colors'
if(i > 0) {
palToExport += '\nelse '
@@ -88,21 +88,21 @@ Rectangle {
function importTheme(jsonStr) {
var jsonObj = JSON.parse(jsonStr)
var themeObj = {"light": {}, "dark":{}}
- var oldTheme = palette.globalTheme;
+ var oldTheme = qgcPal.globalTheme;
- palette.globalTheme = QGCPalette.Light
- palette.colorGroupEnabled = true
+ qgcPal.globalTheme = QGCPalette.Light
+ qgcPal.colorGroupEnabled = true
fillPalette(palette, jsonObj.light.enabled)
- palette.colorGroupEnabled = false
+ qgcPal.colorGroupEnabled = false
fillPalette(palette, jsonObj.light.disabled);
- palette.globalTheme = QGCPalette.Dark
- palette.colorGroupEnabled = true
+ qgcPal.globalTheme = QGCPalette.Dark
+ qgcPal.colorGroupEnabled = true
fillPalette(palette, jsonObj.dark.enabled);
- palette.colorGroupEnabled = false
+ qgcPal.colorGroupEnabled = false
fillPalette(palette, jsonObj.dark.disabled);
- palette.globalTheme = oldTheme;
- palette.colorGroupEnabled = true;
+ qgcPal.globalTheme = oldTheme;
+ qgcPal.colorGroupEnabled = true;
paletteImportExportPopup.close()
}
@@ -127,10 +127,10 @@ Rectangle {
}
background: Rectangle {
anchors.fill: parent
- color: palette.window
+ color: qgcPal.window
radius: ScreenTools.defaultFontPixelHeight * 0.5
border.width: 1
- border.color: palette.text
+ border.color: qgcPal.text
}
Column {
id: impCol
@@ -218,7 +218,7 @@ Rectangle {
id: _header
width: parent.width
height: themeChoice.height * 2
- color: palette.window
+ color: qgcPal.window
anchors.top: parent.top
Row {
id: themeChoice
@@ -238,16 +238,16 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
QGCRadioButton {
text: qsTr("Light")
- checked: _root.palette.globalTheme === QGCPalette.Light
+ checked: _root.qgcPal.globalTheme === QGCPalette.Light
onClicked: {
- _root.palette.globalTheme = QGCPalette.Light
+ _root.qgcPal.globalTheme = QGCPalette.Light
}
}
QGCRadioButton {
text: qsTr("Dark")
- checked: _root.palette.globalTheme === QGCPalette.Dark
+ checked: _root.qgcPal.globalTheme === QGCPalette.Dark
onClicked: {
- _root.palette.globalTheme = QGCPalette.Dark
+ _root.qgcPal.globalTheme = QGCPalette.Dark
}
}
}
@@ -624,13 +624,13 @@ Rectangle {
width: previewGrid.width
height: 60
radius: 3
- color: palette.alertBackground
- border.color: palette.alertBorder
+ color: qgcPal.alertBackground
+ border.color: qgcPal.alertBorder
border.width: 1
anchors.horizontalCenter: parent.horizontalCenter
Label {
text: "Alert Message"
- color: palette.alertText
+ color: qgcPal.alertText
anchors.centerIn: parent
}
}
diff --git a/src/QmlControls/RCChannelMonitor.qml b/src/QmlControls/RCChannelMonitor.qml
index 9325d2bb8..c0801b220 100644
--- a/src/QmlControls/RCChannelMonitor.qml
+++ b/src/QmlControls/RCChannelMonitor.qml
@@ -8,17 +8,17 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
Item {
id: _root
@@ -107,7 +107,7 @@ Item {
Connections {
target: controller
- onChannelRCValueChanged: {
+ onChannelRCValueChanged: (channel, rcValue) => {
if (channelMonitorRepeater.itemAt(channel)) {
channelMonitorRepeater.itemAt(channel).loader.item.rcValue = rcValue
}
diff --git a/src/QmlControls/RCToParamDialog.qml b/src/QmlControls/RCToParamDialog.qml
index 0e833c5af..dd7a8475a 100644
--- a/src/QmlControls/RCToParamDialog.qml
+++ b/src/QmlControls/RCToParamDialog.qml
@@ -7,21 +7,21 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.2
-import QtQuick.Controls 2.5
-import QtQuick.Dialogs 1.3
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controllers
QGCPopupDialog {
title: qsTr("RC To Param")
- buttons: StandardButton.Cancel | StandardButton.Ok
+ buttons: Dialog.Cancel | Dialog.Ok
property alias tuningFact: controller.tuningFact
diff --git a/src/QmlControls/ScreenTools.qml b/src/QmlControls/ScreenTools.qml
index d48364ae7..16ffe5bdd 100644
--- a/src/QmlControls/ScreenTools.qml
+++ b/src/QmlControls/ScreenTools.qml
@@ -1,11 +1,11 @@
pragma Singleton
-import QtQuick 2.12
-import QtQuick.Controls 1.2
-import QtQuick.Window 2.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Window
-import QGroundControl 1.0
-import QGroundControl.ScreenToolsController 1.0
+import QGroundControl
+import QGroundControl.ScreenToolsController
/*!
The ScreenTools Singleton provides information on QGC's standard font metrics. It also provides information on screen
@@ -17,7 +17,7 @@ import QGroundControl.ScreenToolsController 1.0
Usage:
- import QGroundControl.ScreenTools 1.0
+ import QGroundControl.ScreenTools
Rectangle {
anchors.fill: parent
diff --git a/src/QmlControls/ScreenToolsController.cc b/src/QmlControls/ScreenToolsController.cc
index e8a7391aa..4ef8df046 100644
--- a/src/QmlControls/ScreenToolsController.cc
+++ b/src/QmlControls/ScreenToolsController.cc
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include "SettingsManager.h"
@@ -30,7 +31,12 @@ ScreenToolsController::ScreenToolsController()
bool
ScreenToolsController::hasTouch() const
{
- return QTouchDevice::devices().count() > 0 || isMobile();
+ for (const auto& inputDevice: QInputDevice::devices()) {
+ if (inputDevice->type() == QInputDevice::DeviceType::TouchScreen) {
+ return true;
+ }
+ }
+ return false;
}
QString
diff --git a/src/QmlControls/SectionHeader.qml b/src/QmlControls/SectionHeader.qml
index 89e94d535..2d803a2d8 100644
--- a/src/QmlControls/SectionHeader.qml
+++ b/src/QmlControls/SectionHeader.qml
@@ -1,70 +1,57 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
-FocusScope {
- id: _root
- height: column.height
+CheckBox {
+ id: control
+ focusPolicy: Qt.ClickFocus
- property alias color: label.color
- property alias text: label.text
- property bool checked: true
+ property var color: qgcPal.text
property bool showSpacer: true
- property ExclusiveGroup exclusiveGroup: null
+ property ButtonGroup buttonGroup: null
- property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings
+ property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings
- onExclusiveGroupChanged: {
- if (exclusiveGroup)
- exclusiveGroup.bindCheckable(_root)
+ onButtonGroupChanged: {
+ if (buttonGroup) {
+ buttonGroup.addButton(control)
+ }
}
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
- QGCMouseArea {
- anchors.fill: parent
-
- onClicked: {
- _root.focus = true
- checked = !checked
+ contentItem: ColumnLayout {
+ Item {
+ Layout.preferredHeight: control._sectionSpacer
+ width: 1
+ visible: control.showSpacer
}
- ColumnLayout {
- id: column
- anchors.left: parent.left
- anchors.right: parent.right
+ QGCLabel {
+ text: control.text
+ color: control.color
+ Layout.fillWidth: true
- Item {
- height: _sectionSpacer
- width: 1
- visible: showSpacer
+ QGCColoredImage {
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.height / 2
+ height: width
+ source: "/qmlimages/arrow-down.png"
+ color: qgcPal.text
+ visible: !control.checked
}
+ }
- QGCLabel {
- id: label
- Layout.fillWidth: true
-
- QGCColoredImage {
- id: image
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- width: label.height / 2
- height: width
- source: "/qmlimages/arrow-down.png"
- color: qgcPal.text
- visible: !_root.checked
- }
- }
-
- Rectangle {
- Layout.fillWidth: true
- height: 1
- color: qgcPal.text
- }
+ Rectangle {
+ Layout.fillWidth: true
+ height: 1
+ color: qgcPal.text
}
}
+
+ indicator: Item {}
}
diff --git a/src/QmlControls/SliderSwitch.qml b/src/QmlControls/SliderSwitch.qml
index f06575e3a..a6e5d9319 100644
--- a/src/QmlControls/SliderSwitch.qml
+++ b/src/QmlControls/SliderSwitch.qml
@@ -1,8 +1,8 @@
-import QtQuick 2.15
-import QtQuick.Controls 2.15
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
/// The SliderSwitch control implements a sliding switch control similar to the power off
/// control on an iPhone. It supports holding the space bar to slide the switch.
diff --git a/src/QmlControls/SubMenuButton.qml b/src/QmlControls/SubMenuButton.qml
index 451964f77..ff6f28a37 100644
--- a/src/QmlControls/SubMenuButton.qml
+++ b/src/QmlControls/SubMenuButton.qml
@@ -1,16 +1,15 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
// Important Note: SubMenuButtons must manage their checked state manually in order to support
// view switch prevention. This means they can't be checkable or autoExclusive.
Button {
- id: _rootButton
+ id: control
property bool setupComplete: true ///< true: setup complete indicator shows as completed
property bool setupIndicator: true ///< true: show setup complete indicator
property var imageColor: undefined
@@ -18,54 +17,57 @@ Button {
property size sourceSize: Qt.size(ScreenTools.defaultFontPixelHeight * 2, ScreenTools.defaultFontPixelHeight * 2)
text: "Button" ///< Pass in your own button text
- activeFocusOnPress: true
+ focusPolicy: Qt.ClickFocus
implicitHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 3.5 : ScreenTools.defaultFontPixelHeight * 2.5
- implicitWidth: __panel.implicitWidth
+ //implicitWidth: __panel.implicitWidth
+
+ property ButtonGroup buttonGroup: null
+ onButtonGroupChanged: {
+ if (buttonGroup) {
+ buttonGroup.addButton(control)
+ }
+ }
onCheckedChanged: checkable = false
- style: ButtonStyle {
- id: buttonStyle
-
- QGCPalette {
- id: qgcPal
- colorGroupEnabled: control.enabled
- }
-
- property bool showHighlight: control.pressed | control.checked
-
- background: Rectangle {
- id: innerRect
- color: showHighlight ? qgcPal.buttonHighlight : qgcPal.windowShade
-
- implicitWidth: titleBar.x + titleBar.contentWidth + ScreenTools.defaultFontPixelWidth
-
- QGCColoredImage {
- id: image
- anchors.leftMargin: ScreenTools.defaultFontPixelWidth
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- width: ScreenTools.defaultFontPixelHeight * 2
- height: ScreenTools.defaultFontPixelHeight * 2
- fillMode: Image.PreserveAspectFit
- mipmap: true
- color: imageColor ? imageColor : (control.setupComplete ? qgcPal.button : "red")
- source: control.imageResource
- sourceSize: _rootButton.sourceSize
- }
-
- QGCLabel {
- id: titleBar
- anchors.leftMargin: ScreenTools.defaultFontPixelWidth
- anchors.left: image.right
- anchors.verticalCenter: parent.verticalCenter
- verticalAlignment: TextEdit.AlignVCenter
- color: showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
- text: control.text
- }
- }
-
- label: Item {}
+ QGCPalette {
+ id: qgcPal
+ colorGroupEnabled: control.enabled
}
+
+ property bool showHighlight: control.pressed | control.checked
+
+ background: Rectangle {
+ id: innerRect
+ color: showHighlight ? qgcPal.buttonHighlight : qgcPal.windowShade
+
+ implicitWidth: titleBar.x + titleBar.contentWidth + ScreenTools.defaultFontPixelWidth
+
+ QGCColoredImage {
+ id: image
+ anchors.leftMargin: ScreenTools.defaultFontPixelWidth
+ anchors.left: parent.left
+ anchors.verticalCenter: parent.verticalCenter
+ width: ScreenTools.defaultFontPixelHeight * 2
+ height: ScreenTools.defaultFontPixelHeight * 2
+ fillMode: Image.PreserveAspectFit
+ mipmap: true
+ color: imageColor ? imageColor : (control.setupComplete ? qgcPal.button : "red")
+ source: control.imageResource
+ sourceSize: control.sourceSize
+ }
+
+ QGCLabel {
+ id: titleBar
+ anchors.leftMargin: ScreenTools.defaultFontPixelWidth
+ anchors.left: image.right
+ anchors.verticalCenter: parent.verticalCenter
+ verticalAlignment: TextEdit.AlignVCenter
+ color: showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
+ text: control.text
+ }
+ }
+
+ contentItem: Item {}
}
diff --git a/src/QmlControls/TerrainProfile.h b/src/QmlControls/TerrainProfile.h
index bebc9702e..e7baf17a5 100644
--- a/src/QmlControls/TerrainProfile.h
+++ b/src/QmlControls/TerrainProfile.h
@@ -22,6 +22,11 @@ class MissionController;
class QmlObjectListModel;
class FlightPathSegment;
+#ifndef OPAQUE_PTR_TerrainProfile
+ #define OPAQUE_PTR_TerrainProfile
+ Q_DECLARE_OPAQUE_POINTER(MissionController*)
+#endif
+
class TerrainProfile : public QQuickItem
{
Q_OBJECT
diff --git a/src/QmlControls/ToolStrip.qml b/src/QmlControls/ToolStrip.qml
index ad5602c5d..8b48eddfb 100644
--- a/src/QmlControls/ToolStrip.qml
+++ b/src/QmlControls/ToolStrip.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Controls
Rectangle {
id: _root
@@ -84,7 +84,7 @@ Rectangle {
fontPointSize: ScreenTools.smallFontPointSize
toolStripAction: modelData
dropPanel: _dropPanel
- onDropped: _root.dropped(index)
+ onDropped: (index) => _root.dropped(index)
onCheckedChanged: {
// We deal with exclusive check state manually since usinug autoExclusive caused all sorts of crazt problems
diff --git a/src/QmlControls/ToolStripActionList.cc b/src/QmlControls/ToolStripActionList.cc
index 842530567..9dc8b5760 100644
--- a/src/QmlControls/ToolStripActionList.cc
+++ b/src/QmlControls/ToolStripActionList.cc
@@ -32,10 +32,10 @@ void ToolStripActionList::clear(QQmlListProperty* qmlListProperty) {
reinterpret_cast(qmlListProperty->data)->_objectList.clear();
}
-QObject* ToolStripActionList::at(QQmlListProperty* qmlListProperty, int index) {
+QObject* ToolStripActionList::at(QQmlListProperty* qmlListProperty, qsizetype index) {
return reinterpret_cast(qmlListProperty->data)->_objectList[index];
}
-int ToolStripActionList::count(QQmlListProperty* qmlListProperty) {
+qsizetype ToolStripActionList::count(QQmlListProperty* qmlListProperty) {
return reinterpret_cast(qmlListProperty->data)->_objectList.count();
}
diff --git a/src/QmlControls/ToolStripActionList.h b/src/QmlControls/ToolStripActionList.h
index ac01765c1..35557d335 100644
--- a/src/QmlControls/ToolStripActionList.h
+++ b/src/QmlControls/ToolStripActionList.h
@@ -27,10 +27,10 @@ signals:
void modelChanged(void);
private:
- static void append (QQmlListProperty* qmlListProperty, QObject* value);
- static int count (QQmlListProperty* qmlListProperty);
- static QObject* at (QQmlListProperty*, int index);
- static void clear (QQmlListProperty* qmlListProperty);
+ static void append (QQmlListProperty* qmlListProperty, QObject* value);
+ static qsizetype count (QQmlListProperty* qmlListProperty);
+ static QObject* at (QQmlListProperty*, qsizetype index);
+ static void clear (QQmlListProperty* qmlListProperty);
QList _objectList;
};
diff --git a/src/QmlControls/ToolStripHoverButton.qml b/src/QmlControls/ToolStripHoverButton.qml
index 510e595e1..c9ed7d408 100644
--- a/src/QmlControls/ToolStripHoverButton.qml
+++ b/src/QmlControls/ToolStripHoverButton.qml
@@ -7,12 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 2.2
-import QtGraphicalEffects 1.0
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
Button {
id: control
diff --git a/src/QmlControls/VehicleRotationCal.qml b/src/QmlControls/VehicleRotationCal.qml
index 19401286c..ba60a5f97 100644
--- a/src/QmlControls/VehicleRotationCal.qml
+++ b/src/QmlControls/VehicleRotationCal.qml
@@ -8,12 +8,12 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Rectangle {
// Indicates whether calibration is valid for this control
diff --git a/src/QmlControls/VehicleSummaryRow.qml b/src/QmlControls/VehicleSummaryRow.qml
index d0689724d..0d3091126 100644
--- a/src/QmlControls/VehicleSummaryRow.qml
+++ b/src/QmlControls/VehicleSummaryRow.qml
@@ -1,6 +1,6 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
RowLayout {
property string labelText: "Label"
diff --git a/src/QtLocationPlugin/GenericMapProvider.cpp b/src/QtLocationPlugin/GenericMapProvider.cpp
index f0e992872..bbc1c6dde 100644
--- a/src/QtLocationPlugin/GenericMapProvider.cpp
+++ b/src/QtLocationPlugin/GenericMapProvider.cpp
@@ -55,7 +55,7 @@ QString LINZBasemapMapProvider::_getURL(const int x, const int y, const int zoom
QString CustomURLMapProvider::_getURL(const int x, const int y, const int zoom, QNetworkAccessManager* networkManager) {
Q_UNUSED(networkManager)
QString url = qgcApp()->toolbox()->settingsManager()->appSettings()->customURL()->rawValue().toString();
- return url.replace("{x}",QString::number(x)).replace("{y}",QString::number(y)).replace(QRegExp("\\{(z|zoom)\\}"),QString::number(zoom));
+ return url.replace("{x}",QString::number(x)).replace("{y}",QString::number(y)).replace(QRegularExpression("\\{(z|zoom)\\}"),QString::number(zoom));
}
static const QString StatkartMapUrl = QStringLiteral("http://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo4&zoom=%1&x=%2&y=%3");
diff --git a/src/QtLocationPlugin/GoogleMapProvider.cpp b/src/QtLocationPlugin/GoogleMapProvider.cpp
index 2d612b599..96ee257dd 100644
--- a/src/QtLocationPlugin/GoogleMapProvider.cpp
+++ b/src/QtLocationPlugin/GoogleMapProvider.cpp
@@ -13,6 +13,7 @@
#include
#endif
#include
+#include
#include "QGCMapEngine.h"
diff --git a/src/QtLocationPlugin/MapProvider.cpp b/src/QtLocationPlugin/MapProvider.cpp
index 0179ab632..81a732491 100644
--- a/src/QtLocationPlugin/MapProvider.cpp
+++ b/src/QtLocationPlugin/MapProvider.cpp
@@ -12,13 +12,17 @@
#include "MapProvider.h"
-MapProvider::MapProvider(const QString &referrer, const QString &imageFormat,
- const quint32 averageSize, const QGeoMapType::MapStyle mapType, QObject* parent)
- : QObject(parent)
- , _referrer(referrer)
- , _imageFormat(imageFormat)
- , _averageSize(averageSize)
- , _mapType(mapType)
+MapProvider::MapProvider(
+ const QString &referrer,
+ const QString &imageFormat,
+ const quint32 averageSize,
+ const QGeoMapType::MapStyle mapStyle,
+ QObject* parent)
+ : QObject (parent)
+ , _referrer (referrer)
+ , _imageFormat (imageFormat)
+ , _averageSize (averageSize)
+ , _mapStyle (mapStyle)
{
const QStringList langs = QLocale::system().uiLanguages();
if (langs.length() > 0) {
diff --git a/src/QtLocationPlugin/MapProvider.h b/src/QtLocationPlugin/MapProvider.h
index d61a023d8..823183f03 100644
--- a/src/QtLocationPlugin/MapProvider.h
+++ b/src/QtLocationPlugin/MapProvider.h
@@ -31,7 +31,7 @@ class MapProvider : public QObject {
public:
MapProvider(const QString& referrer, const QString& imageFormat, const quint32 averageSize,
- const QGeoMapType::MapStyle mapType = QGeoMapType::CustomMap, QObject* parent = nullptr);
+ const QGeoMapType::MapStyle mapStyle = QGeoMapType::CustomMap, QObject* parent = nullptr);
virtual QNetworkRequest getTileURL(const int x, const int y, const int zoom, QNetworkAccessManager* networkManager);
@@ -39,7 +39,7 @@ public:
quint32 getAverageSize() const { return _averageSize; }
- QGeoMapType::MapStyle getMapStyle() { return _mapType; }
+ QGeoMapType::MapStyle getMapStyle() { return _mapStyle; }
virtual int long2tileX(const double lon, const int z) const;
@@ -64,6 +64,6 @@ protected:
quint32 _averageSize;
QByteArray _userAgent;
QString _language;
- QGeoMapType::MapStyle _mapType;
+ QGeoMapType::MapStyle _mapStyle;
};
diff --git a/src/QtLocationPlugin/QGCMapEngine.cpp b/src/QtLocationPlugin/QGCMapEngine.cpp
index 6f29fc645..8ec1d6d56 100644
--- a/src/QtLocationPlugin/QGCMapEngine.cpp
+++ b/src/QtLocationPlugin/QGCMapEngine.cpp
@@ -222,15 +222,16 @@ QGCMapEngine::cacheTile(const QString& type, const QString& hash, const QByteArr
QString
QGCMapEngine::getTileHash(const QString& type, int x, int y, int z)
{
- return QString::asprintf("%010d%08d%08d%03d", getQGCMapEngine()->urlFactory()->getIdFromType(type), x, y, z);
+ int hash = urlFactory()->hashFromProviderType(type);
+ return QString::asprintf("%010d%08d%08d%03d", hash, x, y, z);
}
//-----------------------------------------------------------------------------
QString
-QGCMapEngine::hashToType(const QString& hash)
+QGCMapEngine::tileHashToType(const QString& tileHash)
{
- QString type = hash.mid(0,10);
- return urlFactory()->getTypeFromId(type.toInt());
+ int providerHash = tileHash.mid(0,10).toInt();
+ return urlFactory()->providerTypeFromHash(providerHash);
}
//-----------------------------------------------------------------------------
@@ -257,7 +258,7 @@ QGCMapEngine::getTileCount(int zoom, double topleftLon, double topleftLat, doubl
QStringList
QGCMapEngine::getMapNameList()
{
- return QStringList(getQGCMapEngine()->urlFactory()->getProviderTable().keys());
+ return getQGCMapEngine()->urlFactory()->getProviderTypes();
}
//-----------------------------------------------------------------------------
diff --git a/src/QtLocationPlugin/QGCMapEngine.h b/src/QtLocationPlugin/QGCMapEngine.h
index 5f8bce7f2..eef731892 100644
--- a/src/QtLocationPlugin/QGCMapEngine.h
+++ b/src/QtLocationPlugin/QGCMapEngine.h
@@ -42,7 +42,8 @@ public:
QStringList getMapNameList ();
const QString userAgent () { return _userAgent; }
void setUserAgent (const QString& ua) { _userAgent = ua; }
- QString hashToType (const QString& hash);
+ QString tileHashToType (const QString& tileHash);
+ QString getTileHash (const QString& type, int x, int y, int z);
quint32 getMaxDiskCache ();
void setMaxDiskCache (quint32 size);
quint32 getMaxMemCache ();
@@ -57,7 +58,6 @@ public:
//-- Tile Math
static QGCTileSet getTileCount (int zoom, double topleftLon, double topleftLat, double bottomRightLon, double bottomRightLat, const QString& mapType);
- static QString getTileHash (const QString& type, int x, int y, int z);
static QString getTypeFromName (const QString& name);
static QString bigSizeToString (quint64 size);
static QString storageFreeSizeToString(quint64 size_MB);
diff --git a/src/QtLocationPlugin/QGCMapTileSet.cpp b/src/QtLocationPlugin/QGCMapTileSet.cpp
index 5888cad88..504cf77aa 100644
--- a/src/QtLocationPlugin/QGCMapTileSet.cpp
+++ b/src/QtLocationPlugin/QGCMapTileSet.cpp
@@ -288,7 +288,7 @@ QGCCachedTileSet::_networkReplyFinished()
}
qCDebug(QGCCachedTileSetLog) << "Tile fetched" << hash;
QByteArray image = reply->readAll();
- QString type = getQGCMapEngine()->hashToType(hash);
+ QString type = getQGCMapEngine()->tileHashToType(hash);
if (type == UrlFactory::kCopernicusElevationProviderKey) {
image = TerrainTile::serializeFromAirMapJson(image);
}
diff --git a/src/QtLocationPlugin/QGCMapUrlEngine.cpp b/src/QtLocationPlugin/QGCMapUrlEngine.cpp
index b41002fbb..6e4bd5d7d 100644
--- a/src/QtLocationPlugin/QGCMapUrlEngine.cpp
+++ b/src/QtLocationPlugin/QGCMapUrlEngine.cpp
@@ -16,19 +16,14 @@
//#define DEBUG_GOOGLE_MAPS
+#include "QGCMapUrlEngine.h"
#include "QGCLoggingCategory.h"
QGC_LOGGING_CATEGORY(QGCMapUrlEngineLog, "QGCMapUrlEngineLog")
-#include "AppSettings.h"
-#include "QGCApplication.h"
-#include "QGCMapEngine.h"
-#include "SettingsManager.h"
-
-
#include
#include
#include
-#include
+#include
#include
#include
@@ -36,178 +31,230 @@ const char* UrlFactory::kCopernicusElevationProviderKey = "Copernicus Elevation"
const char* UrlFactory::kCopernicusElevationProviderNotice = "© Airbus Defence and Space GmbH";
//-----------------------------------------------------------------------------
-UrlFactory::UrlFactory() : _timeout(5 * 1000) {
+UrlFactory::UrlFactory() :
+ _timeout(5 * 1000)
+{
+
+ // The internal Qt code for map plugins has the concept of a Map Id. These ids must start at 1 and be sequential.
+ // Map Ids are used to identify the map provider to use. Because of this we keep the providers in a simple list
+ // such that the index into the list with the map id - 1.
- // Warning : in _providersTable, keys needs to follow this format :
- // "Provider Type"
#ifndef QGC_NO_GOOGLE_MAPS
- _providersTable["Google Street Map"] = new GoogleStreetMapProvider(this);
- _providersTable["Google Satellite"] = new GoogleSatelliteMapProvider(this);
- _providersTable["Google Terrain"] = new GoogleTerrainMapProvider(this);
- _providersTable["Google Hybrid"] = new GoogleHybridMapProvider(this);
- _providersTable["Google Labels"] = new GoogleLabelsMapProvider(this);
+ _providers.append(ProviderPair("Google Street Map", new GoogleStreetMapProvider(this)));
+ _providers.append(ProviderPair("Google Satellite", new GoogleSatelliteMapProvider(this)));
+ _providers.append(ProviderPair("Google Terrain", new GoogleTerrainMapProvider(this)));
+ _providers.append(ProviderPair("Google Hybrid", new GoogleHybridMapProvider(this)));
+ _providers.append(ProviderPair("Google Labels", new GoogleLabelsMapProvider(this)));
#endif
- _providersTable["Bing Road"] = new BingRoadMapProvider(this);
- _providersTable["Bing Satellite"] = new BingSatelliteMapProvider(this);
- _providersTable["Bing Hybrid"] = new BingHybridMapProvider(this);
+ _providers.append(ProviderPair("Bing Road", new BingRoadMapProvider(this)));
+ _providers.append(ProviderPair("Bing Satellite", new BingSatelliteMapProvider(this)));
+ _providers.append(ProviderPair("Bing Hybrid", new BingHybridMapProvider(this)));
- _providersTable["Statkart Topo"] = new StatkartMapProvider(this);
- _providersTable["Statkart Basemap"] = new StatkartBaseMapProvider(this);
+ _providers.append(ProviderPair("Statkart Topo", new StatkartMapProvider(this)));
+ _providers.append(ProviderPair("Statkart Basemap", new StatkartBaseMapProvider(this)));
- _providersTable["Eniro Topo"] = new EniroMapProvider(this);
+ _providers.append(ProviderPair("Eniro Topo", new EniroMapProvider(this)));
// To be add later on Token entry !
- //_providersTable["Esri World Street"] = new EsriWorldStreetMapProvider(this);
- //_providersTable["Esri World Satellite"] = new EsriWorldSatelliteMapProvider(this);
- //_providersTable["Esri Terrain"] = new EsriTerrainMapProvider(this);
+ //_providers.append(ProviderPair("Esri World Street", new EsriWorldStreetMapProvider(this)));
+ //_providers.append(ProviderPair("Esri World Satellite", new EsriWorldSatelliteMapProvider(this)));
+ //_providers.append(ProviderPair("Esri Terrain", new EsriTerrainMapProvider(this)));
- _providersTable["Mapbox Streets"] = new MapboxStreetMapProvider(this);
- _providersTable["Mapbox Light"] = new MapboxLightMapProvider(this);
- _providersTable["Mapbox Dark"] = new MapboxDarkMapProvider(this);
- _providersTable["Mapbox Satellite"] = new MapboxSatelliteMapProvider(this);
- _providersTable["Mapbox Hybrid"] = new MapboxHybridMapProvider(this);
- _providersTable["Mapbox StreetsBasic"] = new MapboxStreetsBasicMapProvider(this);
- _providersTable["Mapbox Outdoors"] = new MapboxOutdoorsMapProvider(this);
- _providersTable["Mapbox Bright"] = new MapboxBrightMapProvider(this);
- _providersTable["Mapbox Custom"] = new MapboxCustomMapProvider(this);
+ _providers.append(ProviderPair("Mapbox Streets", new MapboxStreetMapProvider(this)));
+ _providers.append(ProviderPair("Mapbox Light", new MapboxLightMapProvider(this)));
+ _providers.append(ProviderPair("Mapbox Dark", new MapboxDarkMapProvider(this)));
+ _providers.append(ProviderPair("Mapbox Satellite", new MapboxSatelliteMapProvider(this)));
+ _providers.append(ProviderPair("Mapbox Hybrid", new MapboxHybridMapProvider(this)));
+ _providers.append(ProviderPair("Mapbox StreetsBasic", new MapboxStreetsBasicMapProvider(this)));
+ _providers.append(ProviderPair("Mapbox Outdoors", new MapboxOutdoorsMapProvider(this)));
+ _providers.append(ProviderPair("Mapbox Bright", new MapboxBrightMapProvider(this)));
+ _providers.append(ProviderPair("Mapbox Custom", new MapboxCustomMapProvider(this)));
- //_providersTable["MapQuest Map"] = new MapQuestMapMapProvider(this);
- //_providersTable["MapQuest Sat"] = new MapQuestSatMapProvider(this);
+ //_providers.append(ProviderPair("MapQuest Map", new MapQuestMapMapProvider(this)));
+ //_providers.append(ProviderPair("MapQuest Sat", new MapQuestSatMapProvider(this)));
- _providersTable["VWorld Street Map"] = new VWorldStreetMapProvider(this);
- _providersTable["VWorld Satellite Map"] = new VWorldSatMapProvider(this);
+ _providers.append(ProviderPair("VWorld Street Map", new VWorldStreetMapProvider(this)));
+ _providers.append(ProviderPair("VWorld Satellite Map", new VWorldSatMapProvider(this)));
- _providersTable[kCopernicusElevationProviderKey] = new CopernicusElevationProvider(this);
+ _providers.append(ProviderPair(kCopernicusElevationProviderKey, new CopernicusElevationProvider(this)));
- _providersTable["Japan-GSI Contour"] = new JapanStdMapProvider(this);
- _providersTable["Japan-GSI Seamless"] = new JapanSeamlessMapProvider(this);
- _providersTable["Japan-GSI Anaglyph"] = new JapanAnaglyphMapProvider(this);
- _providersTable["Japan-GSI Slope"] = new JapanSlopeMapProvider(this);
- _providersTable["Japan-GSI Relief"] = new JapanReliefMapProvider(this);
+ _providers.append(ProviderPair("Japan-GSI Contour", new JapanStdMapProvider(this)));
+ _providers.append(ProviderPair("Japan-GSI Seamless", new JapanSeamlessMapProvider(this)));
+ _providers.append(ProviderPair("Japan-GSI Anaglyph", new JapanAnaglyphMapProvider(this)));
+ _providers.append(ProviderPair("Japan-GSI Slope", new JapanSlopeMapProvider(this)));
+ _providers.append(ProviderPair("Japan-GSI Relief", new JapanReliefMapProvider(this)));
- _providersTable["LINZ Basemap"] = new LINZBasemapMapProvider(this);
+ _providers.append(ProviderPair("LINZ Basemap", new LINZBasemapMapProvider(this)));
- _providersTable["CustomURL Custom"] = new CustomURLMapProvider(this);
-}
-
-void UrlFactory::registerProvider(QString name, MapProvider* provider) {
- _providersTable[name] = provider;
+ _providers.append(ProviderPair("CustomURL Custom", new CustomURLMapProvider(this)));
}
//-----------------------------------------------------------------------------
UrlFactory::~UrlFactory() {}
-QString UrlFactory::getImageFormat(int id, const QByteArray& image) {
- QString type = getTypeFromId(id);
- if (_providersTable.find(type) != _providersTable.end()) {
- return _providersTable[getTypeFromId(id)]->getImageFormat(image);
+QString UrlFactory::getImageFormat(int qtMapId, const QByteArray& image) {
+ MapProvider* provider = getMapProviderFromQtMapId(qtMapId);
+ if (provider) {
+ return provider->getImageFormat(image);
} else {
- qCDebug(QGCMapUrlEngineLog) << "getImageFormat : Map not registered :" << type;
+ qCWarning(QGCMapUrlEngineLog) << "getImageFormat : map id not found:" << qtMapId;
return "";
}
}
//-----------------------------------------------------------------------------
QString UrlFactory::getImageFormat(const QString& type, const QByteArray& image) {
- if (_providersTable.find(type) != _providersTable.end()) {
- return _providersTable[type]->getImageFormat(image);
+ MapProvider* provider = getMapProviderFromProviderType(type);
+ if (provider) {
+ return provider->getImageFormat(image);
} else {
- qCDebug(QGCMapUrlEngineLog) << "getImageFormat : Map not registered :" << type;
+ qCWarning(QGCMapUrlEngineLog) << "getImageFormat : type not found:" << type;
return "";
}
}
-QNetworkRequest UrlFactory::getTileURL(int id, int x, int y, int zoom,
- QNetworkAccessManager* networkManager) {
-
- QString type = getTypeFromId(id);
- if (_providersTable.find(type) != _providersTable.end()) {
- return _providersTable[type]->getTileURL(x, y, zoom, networkManager);
+QNetworkRequest UrlFactory::getTileURL(int qtMapId, int x, int y, int zoom, QNetworkAccessManager* networkManager)
+{
+ MapProvider* provider = getMapProviderFromQtMapId(qtMapId);
+ if (provider) {
+ return provider->getTileURL(x, y, zoom, networkManager);
+ } else {
+ qCWarning(QGCMapUrlEngineLog) << "getTileURL : map id not found:" << qtMapId;
+ return QNetworkRequest(QUrl());
}
-
- qCDebug(QGCMapUrlEngineLog) << "getTileURL : map not registered :" << type;
- return QNetworkRequest(QUrl());
}
//-----------------------------------------------------------------------------
-QNetworkRequest UrlFactory::getTileURL(const QString& type, int x, int y, int zoom,
- QNetworkAccessManager* networkManager) {
- if (_providersTable.find(type) != _providersTable.end()) {
- return _providersTable[type]->getTileURL(x, y, zoom, networkManager);
+QNetworkRequest UrlFactory::getTileURL(const QString& type, int x, int y, int zoom, QNetworkAccessManager* networkManager)
+{
+ MapProvider* provider = getMapProviderFromProviderType(type);
+ if (provider) {
+ return provider->getTileURL(x, y, zoom, networkManager);
+ } else {
+ qCWarning(QGCMapUrlEngineLog) << "getTileURL : type not found:" << type;
+ return QNetworkRequest(QUrl());
}
- qCDebug(QGCMapUrlEngineLog) << "getTileURL : map not registered :" << type;
- return QNetworkRequest(QUrl());
}
//-----------------------------------------------------------------------------
quint32 UrlFactory::averageSizeForType(const QString& type) {
- if (_providersTable.find(type) != _providersTable.end()) {
- return _providersTable[type]->getAverageSize();
+ MapProvider* provider = getMapProviderFromProviderType(type);
+ if (provider) {
+ return provider->getAverageSize();
+ } else {
+ qCWarning(QGCMapUrlEngineLog) << "UrlFactory::averageSizeForType type not found:" << type;
+ return AVERAGE_TILE_SIZE;
}
- qCDebug(QGCMapUrlEngineLog) << "UrlFactory::averageSizeForType " << type
- << " Not registered";
-
- // case AirmapElevation:
- // return AVERAGE_AIRMAP_ELEV_SIZE;
- // default:
- // break;
- // }
- return AVERAGE_TILE_SIZE;
}
-QString UrlFactory::getTypeFromId(int id) {
- for (auto it = _providersTable.constBegin(); it != _providersTable.constEnd(); ++it) {
- if ((int)(qHash(it.key()) >> 1) == id) {
- return it.key();
- }
+QString UrlFactory::getProviderTypeFromQtMapId(int qtMapId) {
+ if (qtMapId >= 1 && qtMapId <= _providers.count()) {
+ return _providers.at(qtMapId - 1).first;
+ } else {
+ qCWarning(QGCMapUrlEngineLog) << "getProviderTypeFromQtMapId : map id not found:" << qtMapId;
+ return _providers.at(0).first;
}
- qCDebug(QGCMapUrlEngineLog) << "getTypeFromId : id not found" << id;
- return "";
}
-MapProvider* UrlFactory::getMapProviderFromId(int id)
+MapProvider* UrlFactory::getMapProviderFromProviderType(const QString& type)
{
- QString type = getTypeFromId(id);
- if (!type.isEmpty()) {
- if (_providersTable.find(type) != _providersTable.end()) {
- return _providersTable[type];
+ for (qsizetype i=0; i<_providers.count(); i++) {
+ if (_providers.at(i).first == type) {
+ return _providers.at(i).second;
}
}
+
return nullptr;
}
-//-----------------------------------------------------------------------------
-// Todo : qHash produce a uint bigger than max(int)
-// There is still a low probability for this to
-// generate similar hash for different types
-int
-UrlFactory::getIdFromType(const QString& type)
+MapProvider* UrlFactory::getMapProviderFromQtMapId(int qtMapId)
{
- return (int)(qHash(type)>>1);
+ if (qtMapId >= 1 && qtMapId <= _providers.count()) {
+ return _providers.at(qtMapId - 1).second;
+ } else {
+ return nullptr;
+ }
}
-//-----------------------------------------------------------------------------
-int
-UrlFactory::long2tileX(const QString& mapType, double lon, int z)
+int UrlFactory::getQtMapIdFromProviderType(const QString& type)
{
- return _providersTable[mapType]->long2tileX(lon, z);
+ for (qsizetype i=0; i<_providers.count(); i++) {
+ if (_providers.at(i).first == type) {
+ return i + 1;
+ }
+ }
+
+ qCWarning(QGCMapUrlEngineLog) << "getQtMapIdFromProviderType : type not found:" << type;
+ return 1;
}
-//-----------------------------------------------------------------------------
-int
-UrlFactory::lat2tileY(const QString& mapType, double lat, int z)
+int UrlFactory::long2tileX(const QString& mapType, double lon, int z)
{
- return _providersTable[mapType]->lat2tileY(lat, z);
+ MapProvider* provider = getMapProviderFromProviderType(mapType);
+ if (provider) {
+ return provider->long2tileX(lon, z);
+ } else {
+ qCWarning(QGCMapUrlEngineLog) << "long2tileX : type not found:" << mapType;
+ return 0;
+ }
}
-
-//-----------------------------------------------------------------------------
-QGCTileSet
-UrlFactory::getTileCount(int zoom, double topleftLon, double topleftLat, double bottomRightLon, double bottomRightLat, const QString& mapType)
+int UrlFactory::lat2tileY(const QString& mapType, double lat, int z)
{
- return _providersTable[mapType]->getTileCount(zoom, topleftLon, topleftLat, bottomRightLon, bottomRightLat);
+ MapProvider* provider = getMapProviderFromProviderType(mapType);
+ if (provider) {
+ return provider->lat2tileY(lat, z);
+ } else {
+ qCWarning(QGCMapUrlEngineLog) << "lat2tileY : type not found:" << mapType;
+ return 0;
+ }
}
-bool UrlFactory::isElevation(int mapId){
- return _providersTable[getTypeFromId(mapId)]->_isElevationProvider();
+QGCTileSet UrlFactory::getTileCount(int zoom, double topleftLon, double topleftLat, double bottomRightLon, double bottomRightLat, const QString& mapType)
+{
+ MapProvider* provider = getMapProviderFromProviderType(mapType);
+ if (provider) {
+ return provider->getTileCount(zoom, topleftLon, topleftLat, bottomRightLon, bottomRightLat);
+ } else {
+ qCWarning(QGCMapUrlEngineLog) << "getTileCount : type not found:" << mapType;
+ return QGCTileSet();
+ }
+}
+
+bool UrlFactory::isElevation(int qtMapId)
+{
+ MapProvider* provider = getMapProviderFromQtMapId(qtMapId);
+ if (provider) {
+ return provider->_isElevationProvider();
+ } else {
+ qCWarning(QGCMapUrlEngineLog) << "isElevation : map id not found:" << qtMapId;
+ return false;
+ }
+}
+
+QStringList UrlFactory::getProviderTypes()
+{
+ QStringList types;
+ for (qsizetype i=0; i<_providers.count(); i++) {
+ types.append(_providers.at(i).first);
+ }
+
+ return types;
+}
+
+int UrlFactory::hashFromProviderType(const QString& type)
+{
+ return (int)(qHash(type) >> 1);
+}
+
+QString UrlFactory::providerTypeFromHash(int hash)
+{
+ for (qsizetype i=0; i<_providers.count(); i++) {
+ if (int(qHash(_providers.at(i).first) >> 1) == hash) {
+ return _providers.at(i).first;
+ }
+ }
+
+ qCWarning(QGCMapUrlEngineLog) << "providerTypeFromTileHash : provider not found from hash" << hash;
+ return "";
}
diff --git a/src/QtLocationPlugin/QGCMapUrlEngine.h b/src/QtLocationPlugin/QGCMapUrlEngine.h
index 8d3535c84..e7d1788dd 100644
--- a/src/QtLocationPlugin/QGCMapUrlEngine.h
+++ b/src/QtLocationPlugin/QGCMapUrlEngine.h
@@ -28,6 +28,7 @@
class UrlFactory : public QObject {
Q_OBJECT
+
public:
static const char* kCopernicusElevationProviderKey;
static const char* kCopernicusElevationProviderNotice;
@@ -35,34 +36,36 @@ public:
UrlFactory ();
~UrlFactory ();
+ typedef QPair ProviderPair;
+
QNetworkRequest getTileURL (const QString& type, int x, int y, int zoom, QNetworkAccessManager* networkManager);
- QNetworkRequest getTileURL (int id, int x, int y, int zoom, QNetworkAccessManager* networkManager);
+ QNetworkRequest getTileURL (int qtMapId, int x, int y, int zoom, QNetworkAccessManager* networkManager);
QString getImageFormat (const QString& type, const QByteArray& image);
- QString getImageFormat (int id , const QByteArray& image);
+ QString getImageFormat (int qtMapId, const QByteArray& image);
quint32 averageSizeForType (const QString& type);
int long2tileX(const QString& mapType, double lon, int z);
- int lat2tileY(const QString& mapType, double lat, int z);
+ int lat2tileY (const QString& mapType, double lat, int z);
- QHash getProviderTable(){return _providersTable;}
-
- int getIdFromType(const QString& type);
- QString getTypeFromId(int id);
- MapProvider* getMapProviderFromId(int id);
+ QStringList getProviderTypes ();
+ int getQtMapIdFromProviderType (const QString& type);
+ QString getProviderTypeFromQtMapId (int qtMapId);
+ MapProvider* getMapProviderFromQtMapId (int qtMapId);
+ MapProvider* getMapProviderFromProviderType (const QString& type);
+ int hashFromProviderType (const QString& type);
+ QString providerTypeFromHash (int tileHash);
QGCTileSet getTileCount(int zoom, double topleftLon, double topleftLat,
double bottomRightLon, double bottomRightLat,
const QString& mapType);
- bool isElevation(int mapId);
-
- private:
- int _timeout;
- QHash _providersTable;
- void registerProvider(QString Name, MapProvider* provider);
+ bool isElevation(int qtMapId);
+private:
+ int _timeout;
+ QList _providers;
};
#endif
diff --git a/src/QtLocationPlugin/QGCTileCacheWorker.cpp b/src/QtLocationPlugin/QGCTileCacheWorker.cpp
index f8f918876..bd76aef78 100644
--- a/src/QtLocationPlugin/QGCTileCacheWorker.cpp
+++ b/src/QtLocationPlugin/QGCTileCacheWorker.cpp
@@ -232,7 +232,7 @@ QGCCacheWorker::_deleteBingNoTileTiles()
QSqlQuery query(*_db);
QString s;
//-- Select tiles in default set only, sorted by oldest.
- s = QString("SELECT tileID, tile, hash FROM Tiles WHERE LENGTH(tile) = %1").arg(noTileBytes.count());
+ s = QString("SELECT tileID, tile, hash FROM Tiles WHERE LENGTH(tile) = %1").arg(noTileBytes.length());
QList idsToDelete;
if (query.exec(s)) {
while(query.next()) {
@@ -331,7 +331,7 @@ QGCCacheWorker::_getTile(QGCMapTask* mtask)
if(query.next()) {
const QByteArray& arrray = query.value(0).toByteArray();
const QString& format = query.value(1).toString();
- QString type = getQGCMapEngine()->urlFactory()->getTypeFromId(query.value(2).toInt());
+ const QString& type = query.value(2).toString();
qCDebug(QGCTileCacheLog) << "_getTile() (Found in DB) HASH:" << task->hash();
QGCCacheTile* tile = new QGCCacheTile(task->hash(), arrray, format, type);
task->setTileFetched(tile);
@@ -367,7 +367,7 @@ QGCCacheWorker::_getTileSets(QGCMapTask* mtask)
set->setBottomRightLon(query.value("bottomRightLon").toDouble());
set->setMinZoom(query.value("minZoom").toInt());
set->setMaxZoom(query.value("maxZoom").toInt());
- set->setType(getQGCMapEngine()->urlFactory()->getTypeFromId(query.value("type").toInt()));
+ set->setType(getQGCMapEngine()->urlFactory()->getProviderTypeFromQtMapId(query.value("type").toInt()));
set->setTotalTileCount(query.value("numTiles").toUInt());
set->setDefaultSet(query.value("defaultSet").toInt() != 0);
set->setCreationDate(QDateTime::fromSecsSinceEpoch(query.value("date").toUInt()));
@@ -497,7 +497,7 @@ QGCCacheWorker::_createTileSet(QGCMapTask *mtask)
query.addBindValue(task->tileSet()->bottomRightLon());
query.addBindValue(task->tileSet()->minZoom());
query.addBindValue(task->tileSet()->maxZoom());
- query.addBindValue(getQGCMapEngine()->urlFactory()->getIdFromType(task->tileSet()->type()));
+ query.addBindValue(getQGCMapEngine()->urlFactory()->getQtMapIdFromProviderType(task->tileSet()->type()));
query.addBindValue(task->tileSet()->totalTileCount());
query.addBindValue(QDateTime::currentDateTime().toSecsSinceEpoch());
if(!query.exec()) {
@@ -516,14 +516,14 @@ QGCCacheWorker::_createTileSet(QGCMapTask *mtask)
for(int x = set.tileX0; x <= set.tileX1; x++) {
for(int y = set.tileY0; y <= set.tileY1; y++) {
//-- See if tile is already downloaded
- QString hash = QGCMapEngine::getTileHash(type, x, y, z);
+ QString hash = getQGCMapEngine()->getTileHash(type, x, y, z);
quint64 tileID = _findTile(hash);
if(!tileID) {
//-- Set to download
query.prepare("INSERT OR IGNORE INTO TilesDownload(setID, hash, type, x, y, z, state) VALUES(?, ?, ?, ?, ? ,? ,?)");
query.addBindValue(setID);
query.addBindValue(hash);
- query.addBindValue(getQGCMapEngine()->urlFactory()->getIdFromType(type));
+ query.addBindValue(getQGCMapEngine()->urlFactory()->getQtMapIdFromProviderType(type));
query.addBindValue(x);
query.addBindValue(y);
query.addBindValue(z);
@@ -571,7 +571,7 @@ QGCCacheWorker::_getTileDownloadList(QGCMapTask* mtask)
while(query.next()) {
QGCTile* tile = new QGCTile;
tile->setHash(query.value("hash").toString());
- tile->setType(getQGCMapEngine()->urlFactory()->getTypeFromId(query.value("type").toInt()));
+ tile->setType(getQGCMapEngine()->urlFactory()->getProviderTypeFromQtMapId(query.value("type").toInt()));
tile->setX(query.value("x").toInt());
tile->setY(query.value("y").toInt());
tile->setZ(query.value("z").toInt());
@@ -936,7 +936,7 @@ QGCCacheWorker::_exportSets(QGCMapTask* mtask)
exportQuery.addBindValue(set->bottomRightLon());
exportQuery.addBindValue(set->minZoom());
exportQuery.addBindValue(set->maxZoom());
- exportQuery.addBindValue(getQGCMapEngine()->urlFactory()->getIdFromType(set->type()));
+ exportQuery.addBindValue(getQGCMapEngine()->urlFactory()->getQtMapIdFromProviderType(set->type()));
exportQuery.addBindValue(set->totalTileCount());
exportQuery.addBindValue(set->defaultSet());
exportQuery.addBindValue(QDateTime::currentDateTime().toSecsSinceEpoch());
diff --git a/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp b/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp
index 1bf8cd3ed..98a491a62 100644
--- a/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp
+++ b/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp
@@ -275,7 +275,7 @@ void QGeoCodeReplyQGC::networkReplyFinished()
QGeoLocation location;
location.setAddress(address);
location.setCoordinate(coordinate);
- location.setBoundingBox(boundingBox);
+ location.setBoundingShape(boundingBox);
locations << location;
}
diff --git a/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp b/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp
index 851fa6180..62e6f3ecc 100644
--- a/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp
+++ b/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp
@@ -174,5 +174,5 @@ void QGeoCodingManagerEngineQGC::replyError(QGeoCodeReply::Error errorCode, cons
{
QGeoCodeReply *reply = qobject_cast(sender());
if (reply)
- emit error(reply, errorCode, errorString);
+ emit errorOccurred(reply, errorCode, errorString);
}
diff --git a/src/QtLocationPlugin/QGeoMapReplyQGC.cpp b/src/QtLocationPlugin/QGeoMapReplyQGC.cpp
index 36c148cdd..763d2bb61 100644
--- a/src/QtLocationPlugin/QGeoMapReplyQGC.cpp
+++ b/src/QtLocationPlugin/QGeoMapReplyQGC.cpp
@@ -63,7 +63,7 @@ QGeoTiledMapReplyQGC::QGeoTiledMapReplyQGC(QNetworkAccessManager *networkManager
, _request(request)
, _networkManager(networkManager)
{
- if (_bingNoTileImage.count() == 0) {
+ if (_bingNoTileImage.length() == 0) {
QFile file(":/res/BingNoTileBytes.dat");
file.open(QFile::ReadOnly);
_bingNoTileImage = file.readAll();
@@ -80,7 +80,7 @@ QGeoTiledMapReplyQGC::QGeoTiledMapReplyQGC(QNetworkAccessManager *networkManager
setFinished(true);
setCached(false);
} else {
- QGCFetchTileTask* task = getQGCMapEngine()->createFetchTileTask(getQGCMapEngine()->urlFactory()->getTypeFromId(spec.mapId()), spec.x(), spec.y(), spec.zoom());
+ QGCFetchTileTask* task = getQGCMapEngine()->createFetchTileTask(getQGCMapEngine()->urlFactory()->getProviderTypeFromQtMapId(spec.mapId()), spec.x(), spec.y(), spec.zoom());
connect(task, &QGCFetchTileTask::tileFetched, this, &QGeoTiledMapReplyQGC::cacheReply);
connect(task, &QGCMapTask::error, this, &QGeoTiledMapReplyQGC::cacheError);
getQGCMapEngine()->addTask(task);
@@ -137,13 +137,13 @@ QGeoTiledMapReplyQGC::networkReplyFinished()
//-- Cache it if valid
if(!a.isEmpty()) {
getQGCMapEngine()->cacheTile(
- getQGCMapEngine()->urlFactory()->getTypeFromId(
+ getQGCMapEngine()->urlFactory()->getProviderTypeFromQtMapId(
tileSpec().mapId()),
tileSpec().x(), tileSpec().y(), tileSpec().zoom(), a, format);
}
emit terrainDone(a, QNetworkReply::NoError);
} else {
- MapProvider* mapProvider = urlFactory->getMapProviderFromId(tileSpec().mapId());
+ MapProvider* mapProvider = urlFactory->getMapProviderFromQtMapId(tileSpec().mapId());
if (mapProvider && mapProvider->_isBingProvider() && a.size() && _bingNoTileImage.size() && a == _bingNoTileImage) {
// Bing doesn't return an error if you request a tile above supported zoom level
// It instead returns an image of a missing tile graphic. We need to detect that
@@ -155,7 +155,7 @@ QGeoTiledMapReplyQGC::networkReplyFinished()
setMapImageData(a);
if(!format.isEmpty()) {
setMapImageFormat(format);
- getQGCMapEngine()->cacheTile(getQGCMapEngine()->urlFactory()->getTypeFromId(tileSpec().mapId()), tileSpec().x(), tileSpec().y(), tileSpec().zoom(), a, format);
+ getQGCMapEngine()->cacheTile(getQGCMapEngine()->urlFactory()->getProviderTypeFromQtMapId(tileSpec().mapId()), tileSpec().x(), tileSpec().y(), tileSpec().zoom(), a, format);
}
}
setFinished(true);
@@ -210,7 +210,7 @@ QGeoTiledMapReplyQGC::cacheError(QGCMapTask::TaskType type, QString /*errorStrin
_reply = _networkManager->get(_request);
_reply->setParent(nullptr);
connect(_reply, &QNetworkReply::finished, this, &QGeoTiledMapReplyQGC::networkReplyFinished);
- connect(_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(networkReplyError(QNetworkReply::NetworkError)));
+ connect(_reply, &QNetworkReply::errorOccurred, this, &QGeoTiledMapReplyQGC::networkReplyError);
#if !defined(__mobile__)
_networkManager->setProxy(proxy);
#endif
diff --git a/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp b/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp
index 065ea6b01..259f14e32 100644
--- a/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp
+++ b/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp
@@ -50,13 +50,13 @@
#include
-Q_EXTERN_C Q_DECL_EXPORT const char *qt_plugin_query_metadata();
-Q_EXTERN_C Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance();
+extern "C" Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QPluginMetaData) qt_plugin_query_metadata_v2();
+extern "C" Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance();
//-----------------------------------------------------------------------------
const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_QGeoServiceProviderFactoryQGC()
{
- QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance, qt_plugin_query_metadata};
+ QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance, qt_plugin_query_metadata_v2};
return plugin;
}
diff --git a/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.h b/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.h
index 318bbb39d..b22da4ace 100644
--- a/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.h
+++ b/src/QtLocationPlugin/QGeoServiceProviderPluginQGC.h
@@ -55,13 +55,13 @@ class QGeoServiceProviderFactoryQGC: public QObject, public QGeoServiceProviderF
{
Q_OBJECT
Q_INTERFACES(QGeoServiceProviderFactory)
- Q_PLUGIN_METADATA(IID "org.qt-project.qt.geoservice.serviceproviderfactory/5.0" FILE "qgc_maps_plugin.json")
+ Q_PLUGIN_METADATA(IID "org.qt-project.qt.geoservice.serviceproviderfactory/6.0" FILE "qgc_maps_plugin.json")
public:
- QGeoCodingManagerEngine* createGeocodingManagerEngine (const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const;
- QGeoMappingManagerEngine* createMappingManagerEngine (const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const;
- QGeoRoutingManagerEngine* createRoutingManagerEngine (const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const;
- QPlaceManagerEngine* createPlaceManagerEngine (const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const;
+ QGeoCodingManagerEngine* createGeocodingManagerEngine (const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const override;
+ QGeoMappingManagerEngine* createMappingManagerEngine (const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const override;
+ QGeoRoutingManagerEngine* createRoutingManagerEngine (const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const override;
+ QPlaceManagerEngine* createPlaceManagerEngine (const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const override;
};
#endif // QGEOSERVICEPROVIDERQGC_H
diff --git a/src/QtLocationPlugin/QGeoTileFetcherQGC.cpp b/src/QtLocationPlugin/QGeoTileFetcherQGC.cpp
index b83f06172..5c8379575 100644
--- a/src/QtLocationPlugin/QGeoTileFetcherQGC.cpp
+++ b/src/QtLocationPlugin/QGeoTileFetcherQGC.cpp
@@ -51,6 +51,7 @@
#include
#include
#include
+#include
//-----------------------------------------------------------------------------
QGeoTileFetcherQGC::QGeoTileFetcherQGC(QGeoTiledMappingManagerEngine *parent)
diff --git a/src/QtLocationPlugin/QGeoTileFetcherQGC.h b/src/QtLocationPlugin/QGeoTileFetcherQGC.h
index 163cbab7d..1a77c5682 100644
--- a/src/QtLocationPlugin/QGeoTileFetcherQGC.h
+++ b/src/QtLocationPlugin/QGeoTileFetcherQGC.h
@@ -58,7 +58,7 @@ class QGeoTileFetcherQGC : public QGeoTileFetcher
{
Q_OBJECT
public:
- explicit QGeoTileFetcherQGC (QGeoTiledMappingManagerEngine *parent = 0);
+ explicit QGeoTileFetcherQGC (QGeoTiledMappingManagerEngine *parent = nullptr);
~QGeoTileFetcherQGC();
public slots:
void timeout ();
diff --git a/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp b/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
index 6495f1c18..88aa896be 100644
--- a/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
+++ b/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
@@ -78,20 +78,19 @@ QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVarian
#define QGCGEOMAPTYPE(a,b,c,d,e,f) QGeoMapType(a,b,c,d,e,f,QByteArray("QGroundControl"), cameraCaps)
- /*
- * Google and Bing don't seem kosher at all. This was based on original code from OpenPilot and heavily modified to be used in QGC.
- */
+ // Qt Map Ids must start at 1 and are sequential.
+ int qtMapId = 1;
+ auto urlFactory = getQGCMapEngine()->urlFactory();
+ MapProvider* provider = urlFactory->getMapProviderFromQtMapId(qtMapId);
QList mapList;
- QHashIterator i(getQGCMapEngine()->urlFactory()->getProviderTable());
- while(i.hasNext()){
- i.next();
-
- if(!i.value()->_isElevationProvider()){
- mapList.append(QGCGEOMAPTYPE(i.value()->getMapStyle(), i.key(), i.key(), false, false, getQGCMapEngine()->urlFactory()->getIdFromType(i.key()) ));
- }
+ while (provider) {
+ QString providerType = urlFactory->getProviderTypeFromQtMapId(qtMapId);
+ mapList.append(QGCGEOMAPTYPE(provider->getMapStyle(), providerType, providerType, false, false, qtMapId++));
+ provider = urlFactory->getMapProviderFromQtMapId(qtMapId);
}
+
setSupportedMapTypes(mapList);
//-- Users (QML code) can define a different user agent
diff --git a/src/QtLocationPlugin/QMLControl/OfflineMap.qml b/src/QtLocationPlugin/QMLControl/OfflineMap.qml
index 5db10d441..506a185e2 100644
--- a/src/QtLocationPlugin/QMLControl/OfflineMap.qml
+++ b/src/QtLocationPlugin/QMLControl/OfflineMap.qml
@@ -7,22 +7,22 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
-import QtQuick.Dialogs 1.3
-import QtQuick.Controls.Styles 1.4
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
+import QtQuick.Controls
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FlightMap 1.0
-import QGroundControl.QGCMapEngineManager 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.FlightMap
+import QGroundControl.QGCMapEngineManager
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
Item {
id: offlineMapView
@@ -215,7 +215,7 @@ Item {
folder: QGroundControl.settingsManager.appSettings.missionSavePath
nameFilters: ["Tile Sets (*.qgctiledb)"]
- onAcceptedForSave: {
+ onAcceptedForSave: (file) => {
if (QGroundControl.mapEngineManager.exportSets(file)) {
exportToDiskProgress.open()
} else {
@@ -224,7 +224,7 @@ Item {
close()
}
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
if(!QGroundControl.mapEngineManager.importSets(file)) {
showList();
}
@@ -236,11 +236,15 @@ Item {
id: errorDialog
visible: false
text: QGroundControl.mapEngineManager.errorMessage
- icon: StandardIcon.Critical
- standardButtons: StandardButton.Ok
+ //icon: StandardIcon.Critical
+ buttons: MessageDialog.Ok
title: qsTr("Error Message")
- onYes: {
- errorDialog.visible = false
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ errorDialog.visible = false
+ break;
+ }
}
}
@@ -249,7 +253,7 @@ Item {
QGCPopupDialog {
title: qsTr("Offline Maps Options")
- buttons: StandardButton.Save | StandardButton.Cancel
+ buttons: Dialog.Save | Dialog.Cancel
onAccepted: {
QGroundControl.mapEngineManager.maxDiskCache = parseInt(maxCacheSize.text)
@@ -406,7 +410,7 @@ Item {
text: offlineMapView._currentSelection.defaultSet ?
qsTr("This will delete all tiles INCLUDING the tile sets you have created yourself.\n\nIs this really what you want?") :
qsTr("Delete %1 and all its tiles.\n\nIs this really what you want?").arg(offlineMapView._currentSelection.name)
- buttons: StandardButton.Yes | StandardButton.No
+ buttons: Dialog.Yes | Dialog.No
onAccepted: {
QGroundControl.mapEngineManager.deleteTileSet(offlineMapView._currentSelection)
@@ -425,7 +429,6 @@ Item {
visible: false
allowGCSLocationCenter: true
allowVehicleLocationCenter: false
- gesture.flickDeceleration: 3000
mapName: "OfflineMap"
property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1
@@ -648,7 +651,6 @@ Item {
center: _map.center
activeMapType: _map.activeMapType
zoomLevel: sliderMinZoom.value
- gesture.enabled: false
visible: _showPreview
property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1
@@ -688,7 +690,6 @@ Item {
center: _map.center
activeMapType: _map.activeMapType
zoomLevel: sliderMaxZoom.value
- gesture.enabled: false
visible: _showPreview
property bool isSatelliteMap: activeMapType.name.indexOf("Satellite") > -1 || activeMapType.name.indexOf("Hybrid") > -1
@@ -1140,7 +1141,6 @@ Item {
enabled: QGroundControl.mapEngineManager.selectedCount > 0
onClicked: {
fileDialog.title = qsTr("Export Tile Set")
- fileDialog.selectExisting = false
fileDialog.openForSave()
}
}
@@ -1232,9 +1232,9 @@ Item {
if(QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone) {
return qsTr("Map Tile Set Import");
} else if(QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting) {
- return qsTr("Map Tile Set Import Progress");
+ return qsTr("Map Tile Set import Progress");
} else {
- return qsTr("Map Tile Set Import Completed");
+ return qsTr("Map Tile Set import Completed");
}
}
font.family: ScreenTools.demiboldFontFamily
@@ -1293,8 +1293,7 @@ Item {
width: _bigButtonSize * 1.25
onClicked: {
importDialog.close()
- fileDialog.title = qsTr("Import Tile Set")
- fileDialog.selectExisting = true
+ fileDialog.title = qsTr("import Tile")
fileDialog.openForLoad()
}
}
diff --git a/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc b/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
index ec4fe2dae..884689103 100644
--- a/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
+++ b/src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
@@ -224,7 +224,7 @@ QGCMapEngineManager::mapProviderList()
{
// Extract Provider name from MapName ( format : "Provider Type")
QStringList mapList = getQGCMapEngine()->getMapNameList();
- mapList.replaceInStrings(QRegExp("^([^\\ ]*) (.*)$"),"\\1");
+ mapList.replaceInStrings(QRegularExpression("^([^\\ ]*) (.*)$"),"\\1");
mapList.removeDuplicates();
return mapList;
}
@@ -236,7 +236,7 @@ QGCMapEngineManager::mapTypeList(QString provider)
// Extract type name from MapName ( format : "Provider Type")
QStringList mapList = getQGCMapEngine()->getMapNameList();
mapList = mapList.filter(QRegularExpression(provider));
- mapList.replaceInStrings(QRegExp("^([^\\ ]*) (.*)$"),"\\2");
+ mapList.replaceInStrings(QRegularExpression("^([^\\ ]*) (.*)$"),"\\2");
mapList.removeDuplicates();
return mapList;
}
diff --git a/src/Settings/VideoSettings.cc b/src/Settings/VideoSettings.cc
index 89e8a6b44..3bcf96464 100644
--- a/src/Settings/VideoSettings.cc
+++ b/src/Settings/VideoSettings.cc
@@ -16,7 +16,8 @@
#include
#ifndef QGC_DISABLE_UVC
-#include
+#include
+#include
#endif
const char* VideoSettings::videoSourceNoVideo = QT_TRANSLATE_NOOP("VideoSettings", "No Video Available");
@@ -58,9 +59,9 @@ DECLARE_SETTINGGROUP(Video, "Video")
#endif
#ifndef QGC_DISABLE_UVC
- QList cameras = QCameraInfo::availableCameras();
- for (const QCameraInfo &cameraInfo: cameras) {
- videoSourceList.append(cameraInfo.description());
+ QList videoInputs = QMediaDevices::videoInputs();
+ for (const auto& cameraDevice: videoInputs) {
+ videoSourceList.append(cameraDevice.description());
}
#endif
if (videoSourceList.count() == 0) {
diff --git a/src/Taisync/TaisyncSettings.qml b/src/Taisync/TaisyncSettings.qml
index 1e6ba0a11..c073d3650 100644
--- a/src/Taisync/TaisyncSettings.qml
+++ b/src/Taisync/TaisyncSettings.qml
@@ -8,24 +8,23 @@
****************************************************************************/
-import QtGraphicalEffects 1.0
-import QtMultimedia 5.5
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
-import QtLocation 5.3
-import QtPositioning 5.3
+import QtMultimedia
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtLocation
+import QtPositioning
-import QGroundControl 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.SettingsManager 1.0
+import QGroundControl
+import QGroundControl.Controllers
+import QGroundControl.Controls
+import QGroundControl.FactControls
+import QGroundControl.FactSystem
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
+import QGroundControl.SettingsManager
Rectangle {
id: _root
@@ -410,16 +409,20 @@ Rectangle {
}
MessageDialog {
id: setRTSPDialog
- icon: StandardIcon.Warning
- standardButtons: StandardButton.Yes | StandardButton.No
+ //icon: StandardIcon.Warning
+ buttons: MessageDialog.Yes | MessageDialog.No
title: qsTr("Set Streaming Settings")
text: qsTr("Once changed, you will need to reboot the ground unit for the changes to take effect.\n\nConfirm change?")
- onYes: {
- QGroundControl.taisyncManager.setRTSPSettings(rtspURI.text, rtspAccount.text, rtspPassword.text)
- setRTSPDialog.close()
- }
- onNo: {
- setRTSPDialog.close()
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ QGroundControl.taisyncManager.setRTSPSettings(rtspURI.text, rtspAccount.text, rtspPassword.text)
+ setRTSPDialog.close()
+ break;
+ case MessageDialog.No:
+ setRTSPDialog.close()
+ break;
+ }
}
}
}
@@ -517,15 +520,19 @@ Rectangle {
MessageDialog {
id: setIPDialog
icon: StandardIcon.Warning
- standardButtons: StandardButton.Yes | StandardButton.No
+ buttons: MessageDialog.Yes | MessageDialog.No
title: qsTr("Set Network Settings")
text: qsTr("Once changed, you will need to reboot the ground unit for the changes to take effect. The local IP address must match the one entered (%1).\n\nConfirm change?").arg(localIP.text)
- onYes: {
- QGroundControl.taisyncManager.setIPSettings(localIP.text, remoteIP.text, netMask.text)
- setIPDialog.close()
- }
- onNo: {
- setIPDialog.close()
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ QGroundControl.taisyncManager.setIPSettings(localIP.text, remoteIP.text, netMask.text)
+ setIPDialog.close()
+ break;
+ case MessageDialog.No:
+ setIPDialog.close()
+ break;
+ }
}
}
}
diff --git a/src/Terrain/TerrainQuery.cc b/src/Terrain/TerrainQuery.cc
index 4da3986dd..179e7972d 100644
--- a/src/Terrain/TerrainQuery.cc
+++ b/src/Terrain/TerrainQuery.cc
@@ -455,7 +455,7 @@ bool TerrainTileManager::getAltitudesForCoordinates(const QList&
spec.setX(getQGCMapEngine()->urlFactory()->long2tileX(kMapType, coordinate.longitude(), 1));
spec.setY(getQGCMapEngine()->urlFactory()->lat2tileY(kMapType, coordinate.latitude(), 1));
spec.setZoom(1);
- spec.setMapId(getQGCMapEngine()->urlFactory()->getIdFromType(kMapType));
+ spec.setMapId(getQGCMapEngine()->urlFactory()->getQtMapIdFromProviderType(kMapType));
QGeoTiledMapReplyQGC* reply = new QGeoTiledMapReplyQGC(&_networkManager, request, spec);
connect(reply, &QGeoTiledMapReplyQGC::terrainDone, this, &TerrainTileManager::_terrainDone);
_state = State::Downloading;
@@ -496,7 +496,7 @@ void TerrainTileManager::_terrainDone(QByteArray responseBytes, QNetworkReply::N
// remove from download queue
QGeoTileSpec spec = reply->tileSpec();
- QString hash = QGCMapEngine::getTileHash(kMapType, spec.x(), spec.y(), spec.zoom());
+ QString hash = getQGCMapEngine()->getTileHash(kMapType, spec.x(), spec.y(), spec.zoom());
// handle potential errors
if (error != QNetworkReply::NoError) {
@@ -562,7 +562,7 @@ void TerrainTileManager::_terrainDone(QByteArray responseBytes, QNetworkReply::N
QString TerrainTileManager::_getTileHash(const QGeoCoordinate& coordinate)
{
- QString ret = QGCMapEngine::getTileHash(
+ QString ret = getQGCMapEngine()->getTileHash(
kMapType,
getQGCMapEngine()->urlFactory()->long2tileX(kMapType, coordinate.longitude(), 1),
getQGCMapEngine()->urlFactory()->lat2tileY(kMapType, coordinate.latitude(), 1),
diff --git a/src/Terrain/TerrainQuery.h b/src/Terrain/TerrainQuery.h
index 461e4db51..473b8405b 100644
--- a/src/Terrain/TerrainQuery.h
+++ b/src/Terrain/TerrainQuery.h
@@ -179,7 +179,7 @@ private:
typedef struct {
TerrainAtCoordinateQuery* terrainAtCoordinateQuery;
bool queryObjectDestroyed;
- int cCoord;
+ qsizetype cCoord;
} SentRequestInfo_t;
diff --git a/src/Vehicle/Actuators/ActuatorActions.cc b/src/Vehicle/Actuators/ActuatorActions.cc
index 555ac4263..30964e473 100644
--- a/src/Vehicle/Actuators/ActuatorActions.cc
+++ b/src/Vehicle/Actuators/ActuatorActions.cc
@@ -25,8 +25,11 @@ QString Config::typeToLabel() const
return "";
}
-Action::Action(QObject *parent, const Config &action, const QString &label, int outputFunction,
- Vehicle *vehicle)
+Action::Action([[maybe_unused]] QObject *parent,
+ const Config &action,
+ const QString &label,
+ int outputFunction,
+ Vehicle *vehicle)
: _label(label), _outputFunction(outputFunction), _type(action.type), _vehicle(vehicle)
{
}
@@ -75,7 +78,7 @@ void Action::sendMavlinkRequest()
_commandInProgress = true;
}
-ActionGroup::ActionGroup(QObject *parent, const QString &label, Config::Type type)
+ActionGroup::ActionGroup([[maybe_unused]] QObject *parent, const QString &label, Config::Type type)
: _label(label), _type(type)
{
}
diff --git a/src/Vehicle/Actuators/ActuatorOutputs.cc b/src/Vehicle/Actuators/ActuatorOutputs.cc
index 47a6d16c8..7e04ab88d 100644
--- a/src/Vehicle/Actuators/ActuatorOutputs.cc
+++ b/src/Vehicle/Actuators/ActuatorOutputs.cc
@@ -99,12 +99,11 @@ void ActuatorOutput::getAllChannelFunctions(QList &allFunctions) const
});
}
-bool ActuatorOutput::hasExistingOutputFunctionParams() const
-{
+bool ActuatorOutput::hasExistingOutputFunctionParams() const {
bool hasExistingOutputFunction = false;
- forEachOutputFunction([&hasExistingOutputFunction](ActuatorOutputSubgroup*, ChannelConfigInstance*, Fact* fact) {
- hasExistingOutputFunction = true;
- });
+ forEachOutputFunction([&hasExistingOutputFunction](
+ ActuatorOutputSubgroup *, ChannelConfigInstance *,
+ [[maybe_unused]] Fact *fact) { hasExistingOutputFunction = true; });
return hasExistingOutputFunction;
}
diff --git a/src/Vehicle/Actuators/Actuators.cc b/src/Vehicle/Actuators/Actuators.cc
index 01231d4b4..60d91ff06 100644
--- a/src/Vehicle/Actuators/Actuators.cc
+++ b/src/Vehicle/Actuators/Actuators.cc
@@ -291,7 +291,7 @@ void Actuators::updateFunctionMetadata()
for (int groupIdx = 0; groupIdx < _actuatorOutputs->count(); groupIdx++) {
ActuatorOutput* group = qobject_cast(_actuatorOutputs->get(groupIdx));
- group->forEachOutputFunction([&](ActuatorOutputSubgroup* subgroup, ChannelConfigInstance*, Fact* fact) {
+ group->forEachOutputFunction([&]([[maybe_unused]] ActuatorOutputSubgroup* subgroup, ChannelConfigInstance*, Fact* fact) {
QStringList enumStrings = fact->enumStrings();
if (!enumStrings.empty()) {
QVariantList enumValues = fact->enumValues();
diff --git a/src/Vehicle/Actuators/GeometryImage.cc b/src/Vehicle/Actuators/GeometryImage.cc
index e83c2b48f..e9a70d08a 100644
--- a/src/Vehicle/Actuators/GeometryImage.cc
+++ b/src/Vehicle/Actuators/GeometryImage.cc
@@ -15,8 +15,7 @@
using namespace GeometryImage;
-
-static void generateTestGeometries(VehicleGeometryImageProvider& provider)
+static void generateTestGeometries([[maybe_unused]] VehicleGeometryImageProvider &provider)
{
#if 0 // enable this to generate a set of test geometry images on startup in the current working directory
const QString imagePrefix = "test_geometry_";
@@ -163,7 +162,7 @@ void VehicleGeometryImageProvider::drawAxisIndicator(QPainter& p, const QPointF&
}
}
-QPixmap VehicleGeometryImageProvider::requestPixmap(const QString& id, QSize* size, const QSize& requestedSize)
+QPixmap VehicleGeometryImageProvider::requestPixmap([[maybe_unused]] const QString& id, QSize* size, const QSize& requestedSize)
{
int width = requestedSize.width();
int height = requestedSize.height();
@@ -270,7 +269,7 @@ QPixmap VehicleGeometryImageProvider::requestPixmap(const QString& id, QSize* si
};
// draw line from center to actuators first
- iterateMotors(actuators, [&](const ActuatorGeometry& actuator, QPointF pos) {
+ iterateMotors(actuators, [&]([[maybe_unused]] const ActuatorGeometry& actuator, QPointF pos) {
p.setPen(QPen{frameColor, frameWidth});
p.drawLine(QPointF{offsetX, offsetY}, pos);
});
diff --git a/src/Vehicle/Actuators/Mixer.cc b/src/Vehicle/Actuators/Mixer.cc
index e81bdda52..c2eec3893 100644
--- a/src/Vehicle/Actuators/Mixer.cc
+++ b/src/Vehicle/Actuators/Mixer.cc
@@ -81,8 +81,10 @@ void ChannelConfig::instanceVisibleChanged()
}
}
-ChannelConfigInstance* ChannelConfigVirtualAxis::instantiate(int paramIndex, int actuatorTypeIndex,
- ParameterManager* parameterManager, std::function factAddedCb)
+ChannelConfigInstance *ChannelConfigVirtualAxis::instantiate(
+ [[maybe_unused]] int paramIndex, [[maybe_unused]] int actuatorTypeIndex,
+ [[maybe_unused]] ParameterManager *parameterManager,
+ [[maybe_unused]] std::function factAddedCb)
{
ChannelConfigInstance* instance = new ChannelConfigInstanceVirtualAxis(this, *this);
channelInstanceCreated(instance);
@@ -366,7 +368,7 @@ bool MixerChannel::getGeometry(const ActuatorTypes& actuatorTypes, const MixerOp
return numPositionAxis == 3;
}
-Fact* MixerChannel::getFact(Function function) const
+Fact* MixerChannel::getFact([[maybe_unused]] Function function) const
{
for (int i = 0; i < _configInstances->count(); ++i) {
ChannelConfigInstance* configInstance = _configInstances->value(i);
diff --git a/src/Vehicle/Actuators/Mixer.h b/src/Vehicle/Actuators/Mixer.h
index 955b5196b..b038a6e70 100644
--- a/src/Vehicle/Actuators/Mixer.h
+++ b/src/Vehicle/Actuators/Mixer.h
@@ -224,7 +224,7 @@ public:
int ruleApplyIdentifierIdx() const { return _ruleApplyIdentifierIdx; }
void setRuleApplyIdentifierIdx(int idx) { _ruleApplyIdentifierIdx = idx; }
- virtual void allInstancesInitialized(QmlObjectListModel* configInstances) {}
+ virtual void allInstancesInitialized([[maybe_unused]] QmlObjectListModel* configInstances) {}
signals:
void visibleChanged();
diff --git a/src/Vehicle/CompInfoParam.cc b/src/Vehicle/CompInfoParam.cc
index 11339dd81..6e20ce962 100644
--- a/src/Vehicle/CompInfoParam.cc
+++ b/src/Vehicle/CompInfoParam.cc
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
QGC_LOGGING_CATEGORY(CompInfoParamLog, "CompInfoParamLog")
diff --git a/src/Vehicle/ComponentInformationManager.cc b/src/Vehicle/ComponentInformationManager.cc
index 20bd1ca2f..4a385d05e 100644
--- a/src/Vehicle/ComponentInformationManager.cc
+++ b/src/Vehicle/ComponentInformationManager.cc
@@ -229,7 +229,8 @@ QString RequestMetaDataTypeStateMachine::typeToString(void)
return "Unknown";
}
-static void _requestMessageResultHandler(void* resultHandlerData, MAV_RESULT result, Vehicle::RequestMessageResultHandlerFailureCode_t failureCode, const mavlink_message_t &message)
+static void _requestMessageResultHandler(void* resultHandlerData, MAV_RESULT result,
+ [[maybe_unused]] Vehicle::RequestMessageResultHandlerFailureCode_t failureCode, const mavlink_message_t &message)
{
RequestMetaDataTypeStateMachine* requestMachine = static_cast(resultHandlerData);
diff --git a/src/Vehicle/StandardModes.cc b/src/Vehicle/StandardModes.cc
index e58ca9073..f8e5bcc82 100644
--- a/src/Vehicle/StandardModes.cc
+++ b/src/Vehicle/StandardModes.cc
@@ -12,9 +12,9 @@
QGC_LOGGING_CATEGORY(StandardModesLog, "StandardModesLog")
-
-static void requestMessageResultHandler(void* resultHandlerData, MAV_RESULT result,
- Vehicle::RequestMessageResultHandlerFailureCode_t failureCode, const mavlink_message_t &message)
+static void requestMessageResultHandler(void *resultHandlerData, MAV_RESULT result,
+ [[maybe_unused]] Vehicle::RequestMessageResultHandlerFailureCode_t failureCode,
+ const mavlink_message_t &message)
{
StandardModes* standardModes = static_cast(resultHandlerData);
standardModes->gotMessage(result, message);
@@ -103,7 +103,7 @@ void StandardModes::ensureUniqueModeNames()
// restarting dynamic modes, it might not be.
for (auto iter = _modes.begin(); iter != _modes.end(); ++iter) {
int duplicateIdx = 0;
- for (auto iter2 = iter + 1; iter2 != _modes.end(); ++iter2) {
+ for (auto iter2 = std::next(iter); iter2 != _modes.end(); ++iter2) {
if (iter.value().name == iter2.value().name) {
iter2.value().name += QStringLiteral(" (%1)").arg(duplicateIdx + 1);
++duplicateIdx;
diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc
index a80833936..6c13da4e1 100644
--- a/src/Vehicle/Vehicle.cc
+++ b/src/Vehicle/Vehicle.cc
@@ -1726,7 +1726,8 @@ void Vehicle::setEventsMetadata(uint8_t compid, const QString& metadataJsonFileN
false);
}
-void Vehicle::setActuatorsMetadata(uint8_t compid, const QString& metadataJsonFileName)
+void Vehicle::setActuatorsMetadata([[maybe_unused]] uint8_t compid,
+ const QString &metadataJsonFileName)
{
if (!_actuators) {
_actuators = new Actuators(this, this);
@@ -3597,6 +3598,7 @@ void Vehicle::startCalibration(Vehicle::CalibrationType calType)
// Gyro cal for ArduCopter only
param1 = 1;
}
+ break;
case CalibrationAPMAccelSimple:
param5 = 4;
break;
diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h
index 87bf0b278..436b96907 100644
--- a/src/Vehicle/Vehicle.h
+++ b/src/Vehicle/Vehicle.h
@@ -79,6 +79,18 @@ class InitialConnectStateMachine;
class Autotune;
class RemoteIDManager;
+#ifndef OPAQUE_PTR_Vehicle
+ #define OPAQUE_PTR_Vehicle
+ Q_DECLARE_OPAQUE_POINTER(AutoPilotPlugin*)
+ Q_DECLARE_OPAQUE_POINTER(TrajectoryPoints*)
+ Q_DECLARE_OPAQUE_POINTER(ParameterManager*)
+ Q_DECLARE_OPAQUE_POINTER(VehicleObjectAvoidance*)
+ Q_DECLARE_OPAQUE_POINTER(Autotune*)
+ Q_DECLARE_OPAQUE_POINTER(RemoteIDManager*)
+ Q_DECLARE_OPAQUE_POINTER(Actuators*)
+ Q_DECLARE_OPAQUE_POINTER(QGCCameraManager*)
+#endif
+
namespace events {
namespace parser {
class ParsedEvent;
diff --git a/src/VehicleSetup/Bootloader.cc b/src/VehicleSetup/Bootloader.cc
index 69a3fa1d5..4171137d2 100644
--- a/src/VehicleSetup/Bootloader.cc
+++ b/src/VehicleSetup/Bootloader.cc
@@ -422,7 +422,7 @@ bool Bootloader::_ihxProgram(const FirmwareImage* image)
return false;
}
- qCDebug(FirmwareUpgradeVerboseLog) << QString("Bootloader::_ihxProgram - address:0x%1 size:%2 block:%3").arg(flashAddress, 8, 16, QLatin1Char('0')).arg(bytes.count()).arg(index);
+ qCDebug(FirmwareUpgradeVerboseLog) << QString("Bootloader::_ihxProgram - address:0x%1 size:%2 block:%3").arg(flashAddress, 8, 16, QLatin1Char('0')).arg(bytes.length()).arg(index);
// Set flash address
@@ -445,7 +445,7 @@ bool Bootloader::_ihxProgram(const FirmwareImage* image)
// Flash
int bytesIndex = 0;
- uint16_t bytesLeftToWrite = bytes.count();
+ uint16_t bytesLeftToWrite = bytes.length();
while (bytesLeftToWrite > 0) {
uint8_t bytesToWrite;
@@ -594,7 +594,7 @@ bool Bootloader::_ihxVerifyBytes(const FirmwareImage* image)
return false;
}
- qCDebug(FirmwareUpgradeLog) << QString("Bootloader::_ihxVerifyBytes - address:0x%1 size:%2 block:%3").arg(readAddress, 8, 16, QLatin1Char('0')).arg(imageBytes.count()).arg(index);
+ qCDebug(FirmwareUpgradeLog) << QString("Bootloader::_ihxVerifyBytes - address:0x%1 size:%2 block:%3").arg(readAddress, 8, 16, QLatin1Char('0')).arg(imageBytes.length()).arg(index);
// Set read address
@@ -617,7 +617,7 @@ bool Bootloader::_ihxVerifyBytes(const FirmwareImage* image)
// Read back
int bytesIndex = 0;
- uint16_t bytesLeftToRead = imageBytes.count();
+ uint16_t bytesLeftToRead = imageBytes.length();
while (bytesLeftToRead > 0) {
uint8_t bytesToRead;
diff --git a/src/VehicleSetup/FirmwareImage.cc b/src/VehicleSetup/FirmwareImage.cc
index 2dba2b2a3..2d255d8aa 100644
--- a/src/VehicleSetup/FirmwareImage.cc
+++ b/src/VehicleSetup/FirmwareImage.cc
@@ -68,7 +68,7 @@ bool FirmwareImage::_readByteFromStream(QTextStream& stream, uint8_t& byte)
{
QString hex = stream.read(2);
- if (hex.count() != 2) {
+ if (hex.length() != 2) {
return false;
}
@@ -82,7 +82,7 @@ bool FirmwareImage::_readWordFromStream(QTextStream& stream, uint16_t& word)
{
QString hex = stream.read(4);
- if (hex.count() != 4) {
+ if (hex.length() != 4) {
return false;
}
@@ -154,16 +154,16 @@ bool FirmwareImage::_ihxLoad(const QString& ihxFilename)
// Can we append this block to the last one?
- if (_ihxBlocks.count()) {
- int lastBlockIndex = _ihxBlocks.count() - 1;
+ if (_ihxBlocks.length()) {
+ int lastBlockIndex = _ihxBlocks.length() - 1;
- if (_ihxBlocks[lastBlockIndex].address + _ihxBlocks[lastBlockIndex].bytes.count() == address) {
+ if (_ihxBlocks[lastBlockIndex].address + _ihxBlocks[lastBlockIndex].bytes.length() == address) {
appendToLastBlock = true;
}
}
if (appendToLastBlock) {
- _ihxBlocks[_ihxBlocks.count() - 1].bytes += bytes;
+ _ihxBlocks[_ihxBlocks.length() - 1].bytes += bytes;
// Too noisy even for verbose
//qCDebug(FirmwareUpgradeVerboseLog) << QString("_ihxLoad - append - address:%1 size:%2 block:%3").arg(address).arg(blockByteCount).arg(ihxBlockCount());
} else {
@@ -272,7 +272,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
if (parameterFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
qint64 bytesWritten = parameterFile.write(decompressedBytes);
- if (bytesWritten != decompressedBytes.count()) {
+ if (bytesWritten != decompressedBytes.length()) {
emit statusMessage(tr("Write failed for parameter meta data file, error: %1").arg(parameterFile.errorString()));
parameterFile.close();
QFile::remove(parameterFilename);
@@ -300,7 +300,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
if (airframeFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
qint64 bytesWritten = airframeFile.write(decompressedBytes);
- if (bytesWritten != decompressedBytes.count()) {
+ if (bytesWritten != decompressedBytes.length()) {
// FIXME: What about these warnings?
emit statusMessage(tr("Write failed for airframe meta data file, error: %1").arg(airframeFile.errorString()));
airframeFile.close();
@@ -325,7 +325,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
}
// Pad image to 4-byte boundary
- while ((decompressedBytes.count() % 4) != 0) {
+ while ((decompressedBytes.length() % 4) != 0) {
decompressedBytes.append(static_cast(static_cast(0xFF)));
}
@@ -340,7 +340,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
}
qint64 bytesWritten = decompressFile.write(decompressedBytes);
- if (bytesWritten != decompressedBytes.count()) {
+ if (bytesWritten != decompressedBytes.length()) {
emit statusMessage(tr("Write failed for decompressed image file, error: %1").arg(decompressFile.errorString()));
return false;
}
@@ -376,12 +376,12 @@ bool FirmwareImage::_decompressJsonValue(const QJsonObject& jsonObject, ///< J
// this should be fine.
QStringList parts = QString(jsonDocBytes).split(QString("\"%1\": \"").arg(bytesKey));
- if (parts.count() == 1) {
+ if (parts.length() == 1) {
emit statusMessage(tr("Could not find compressed bytes for %1 in Firmware file").arg(bytesKey));
return false;
}
parts = parts.last().split("\"");
- if (parts.count() == 1) {
+ if (parts.length() == 1) {
emit statusMessage(tr("Incorrectly formed compressed bytes section for %1 in Firmware file").arg(bytesKey));
return false;
}
@@ -397,12 +397,12 @@ bool FirmwareImage::_decompressJsonValue(const QJsonObject& jsonObject, ///< J
raw.append(QByteArray::fromBase64(raw64));
decompressedBytes = qUncompress(raw);
- if (decompressedBytes.count() == 0) {
+ if (decompressedBytes.length() == 0) {
emit statusMessage(tr("Firmware file has 0 length %1").arg(bytesKey));
return false;
}
- if (decompressedBytes.count() != decompressedSize) {
- emit statusMessage(tr("Size for decompressed %1 does not match stored size: Expected(%1) Actual(%2)").arg(decompressedSize).arg(decompressedBytes.count()));
+ if (decompressedBytes.length() != decompressedSize) {
+ emit statusMessage(tr("Size for decompressed %1 does not match stored size: Expected(%1) Actual(%2)").arg(decompressedSize).arg(decompressedBytes.length()));
return false;
}
@@ -413,7 +413,7 @@ bool FirmwareImage::_decompressJsonValue(const QJsonObject& jsonObject, ///< J
uint16_t FirmwareImage::ihxBlockCount(void) const
{
- return _ihxBlocks.count();
+ return _ihxBlocks.length();
}
bool FirmwareImage::ihxGetBlock(uint16_t index, uint16_t& address, QByteArray& bytes) const
diff --git a/src/VehicleSetup/FirmwareUpgrade.qml b/src/VehicleSetup/FirmwareUpgrade.qml
index 5d4611dec..1ba003280 100644
--- a/src/VehicleSetup/FirmwareUpgrade.qml
+++ b/src/VehicleSetup/FirmwareUpgrade.qml
@@ -8,19 +8,19 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Palette
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
SetupPage {
id: firmwarePage
@@ -75,9 +75,8 @@ SetupPage {
id: customFirmwareDialog
title: qsTr("Select Firmware File")
nameFilters: [qsTr("Firmware Files (*.px4 *.apj *.bin *.ihx)"), qsTr("All Files (*)")]
- selectExisting: true
folder: QGroundControl.settingsManager.appSettings.logSavePath
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
controller.flashFirmwareUrl(file)
close()
}
@@ -140,7 +139,7 @@ SetupPage {
QGCPopupDialog {
id: firmwareSelectDialog
title: qsTr("Firmware Setup")
- buttons: StandardButton.Ok | StandardButton.Cancel
+ buttons: Dialog.Ok | Dialog.Cancel
property bool showFirmwareTypeSelection: _advanced.checked
property bool px4Flow: controller.px4FlowBoard
@@ -479,14 +478,13 @@ SetupPage {
Layout.preferredWidth: parent.width
Layout.fillHeight: true
readOnly: true
- frameVisible: false
font.pointSize: ScreenTools.defaultFontPointSize
textFormat: TextEdit.RichText
text: _singleFirmwareMode ? welcomeTextSingle : welcomeText
+ color: qgcPal.text
- style: TextAreaStyle {
- textColor: qgcPal.text
- backgroundColor: qgcPal.windowShade
+ background: Rectangle {
+ color: qgcPal.windowShade
}
}
} // ColumnLayout
diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc
index 7524a12e0..ffe483af2 100644
--- a/src/VehicleSetup/FirmwareUpgradeController.cc
+++ b/src/VehicleSetup/FirmwareUpgradeController.cc
@@ -292,7 +292,7 @@ void FirmwareUpgradeController::_foundBoardInfo(int bootloaderVersion, int board
if (_startFlashWhenBootloaderFound) {
flash(_startFlashWhenBootloaderFoundFirmwareIdentity);
} else {
- if (_rgManifestFirmwareInfo.count()) {
+ if (_rgManifestFirmwareInfo.length()) {
_buildAPMFirmwareNames();
}
emit showFirmwareSelectDlg();
@@ -598,7 +598,7 @@ void FirmwareUpgradeController::_buildAPMFirmwareNames(void)
if (_apmFirmwareNamesBestIndex == -1) {
_apmFirmwareNamesBestIndex++;
- if (_apmFirmwareNames.count() > 1) {
+ if (_apmFirmwareNames.length() > 1) {
_apmFirmwareNames.prepend(tr("Choose board type"));
_apmFirmwareUrls.prepend(QString());
}
@@ -610,8 +610,8 @@ void FirmwareUpgradeController::_buildAPMFirmwareNames(void)
FirmwareUpgradeController::FirmwareVehicleType_t FirmwareUpgradeController::vehicleTypeFromFirmwareSelectionIndex(int index)
{
- if (index < 0 || index >= _apmVehicleTypeFromCurrentVersionList.count()) {
- qWarning() << "Invalid index, index:count" << index << _apmVehicleTypeFromCurrentVersionList.count();
+ if (index < 0 || index >= _apmVehicleTypeFromCurrentVersionList.length()) {
+ qWarning() << "Invalid index, index:count" << index << _apmVehicleTypeFromCurrentVersionList.length();
return CopterFirmware;
}
@@ -749,8 +749,8 @@ void FirmwareUpgradeController::_ardupilotManifestDownloadComplete(QString remot
QString pid = vidpid[1];
bool ok;
- firmwareInfo.rgVID.append(vid.right(vid.count() - 2).toInt(&ok, 16));
- firmwareInfo.rgPID.append(pid.right(pid.count() - 2).toInt(&ok, 16));
+ firmwareInfo.rgVID.append(vid.right(vid.length() - 2).toInt(&ok, 16));
+ firmwareInfo.rgPID.append(pid.right(pid.length() - 2).toInt(&ok, 16));
}
QString brandName = firmwareJson[_manifestBrandNameKey].toString();
diff --git a/src/VehicleSetup/JoystickConfig.qml b/src/VehicleSetup/JoystickConfig.qml
index c7d4f1bc2..f95185149 100644
--- a/src/VehicleSetup/JoystickConfig.qml
+++ b/src/VehicleSetup/JoystickConfig.qml
@@ -8,18 +8,18 @@
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
/// Joystick Config
SetupPage {
diff --git a/src/VehicleSetup/JoystickConfigAdvanced.qml b/src/VehicleSetup/JoystickConfigAdvanced.qml
index 817127805..f4f067fd0 100644
--- a/src/VehicleSetup/JoystickConfigAdvanced.qml
+++ b/src/VehicleSetup/JoystickConfigAdvanced.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
Item {
width: grid.width + (ScreenTools.defaultFontPixelWidth * 2)
@@ -77,8 +77,8 @@ Item {
QGCSlider {
id: expoSlider
width: ScreenTools.defaultFontPixelWidth * 20
- minimumValue: 0
- maximumValue: 0.75
+ from: 0
+ to: 0.75
Component.onCompleted: value = -_activeJoystick.exponential
onValueChanged: _activeJoystick.exponential = -value
}
diff --git a/src/VehicleSetup/JoystickConfigButtons.qml b/src/VehicleSetup/JoystickConfigButtons.qml
index 7fd3cb143..ca1dd0b77 100644
--- a/src/VehicleSetup/JoystickConfigButtons.qml
+++ b/src/VehicleSetup/JoystickConfigButtons.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
ColumnLayout {
width: availableWidth
diff --git a/src/VehicleSetup/JoystickConfigCalibration.qml b/src/VehicleSetup/JoystickConfigCalibration.qml
index c1ee62832..39f68ae07 100644
--- a/src/VehicleSetup/JoystickConfigCalibration.qml
+++ b/src/VehicleSetup/JoystickConfigCalibration.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
Item {
height: calCol.height + ScreenTools.defaultFontPixelHeight * 2
@@ -138,7 +138,7 @@ Item {
preventStealing: true
property real startX
property real direction
- onPressed: {
+ onPressed: (mouse) => {
startX = mouseX
direction = startX > width/2 ? 1 : -1
parent.item.deadbandColor = "#3C6315"
diff --git a/src/VehicleSetup/JoystickConfigGeneral.qml b/src/VehicleSetup/JoystickConfigGeneral.qml
index 8a479a110..54cf348fa 100644
--- a/src/VehicleSetup/JoystickConfigGeneral.qml
+++ b/src/VehicleSetup/JoystickConfigGeneral.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
Item {
width: mainCol.width + (ScreenTools.defaultFontPixelWidth * 2)
diff --git a/src/VehicleSetup/PX4FlowSensor.qml b/src/VehicleSetup/PX4FlowSensor.qml
index 8cd3d22a9..3f40711d1 100644
--- a/src/VehicleSetup/PX4FlowSensor.qml
+++ b/src/VehicleSetup/PX4FlowSensor.qml
@@ -8,14 +8,14 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
Item {
QGCLabel {
diff --git a/src/VehicleSetup/SetupParameterEditor.qml b/src/VehicleSetup/SetupParameterEditor.qml
index 7968e2a1e..dd1f645d3 100644
--- a/src/VehicleSetup/SetupParameterEditor.qml
+++ b/src/VehicleSetup/SetupParameterEditor.qml
@@ -8,12 +8,12 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick
+import QtQuick.Controls
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
ParameterEditor {
diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml
index cd190b39c..925858853 100644
--- a/src/VehicleSetup/SetupView.qml
+++ b/src/VehicleSetup/SetupView.qml
@@ -7,16 +7,16 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.AutoPilotPlugin 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.MultiVehicleManager 1.0
+import QGroundControl
+import QGroundControl.AutoPilotPlugin
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.MultiVehicleManager
Rectangle {
id: setupView
@@ -25,7 +25,7 @@ Rectangle {
QGCPalette { id: qgcPal; colorGroupEnabled: true }
- ExclusiveGroup { id: setupButtonGroup }
+ ButtonGroup { id: setupButtonGroup }
readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight
readonly property real _defaultTextWidth: ScreenTools.defaultFontPixelWidth
@@ -214,7 +214,7 @@ Rectangle {
SubMenuButton {
imageResource: modelData.icon
setupIndicator: false
- exclusiveGroup: setupButtonGroup
+ buttonGroup: setupButtonGroup
text: modelData.title
visible: _corePlugin && _corePlugin.options.combineSettingsAndSetup
onClicked: showPanel(this, modelData.url)
@@ -227,7 +227,7 @@ Rectangle {
imageResource: "/qmlimages/VehicleSummaryIcon.png"
setupIndicator: false
checked: true
- exclusiveGroup: setupButtonGroup
+ buttonGroup: setupButtonGroup
text: qsTr("Summary")
Layout.fillWidth: true
@@ -238,7 +238,7 @@ Rectangle {
id: firmwareButton
imageResource: "/qmlimages/FirmwareUpgradeIcon.png"
setupIndicator: false
- exclusiveGroup: setupButtonGroup
+ buttonGroup: setupButtonGroup
visible: !ScreenTools.isMobile && _corePlugin.options.showFirmwareUpgrade
text: qsTr("Firmware")
Layout.fillWidth: true
@@ -248,7 +248,7 @@ Rectangle {
SubMenuButton {
id: px4FlowButton
- exclusiveGroup: setupButtonGroup
+ buttonGroup: setupButtonGroup
visible: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle.vehicleLinkManager.primaryLinkIsPX4Flow : false
setupIndicator: false
text: qsTr("PX4Flow")
@@ -261,7 +261,7 @@ Rectangle {
imageResource: "/qmlimages/Joystick.png"
setupIndicator: true
setupComplete: _activeJoystick ? _activeJoystick.calibrated || _buttonsOnly : false
- exclusiveGroup: setupButtonGroup
+ buttonGroup: setupButtonGroup
visible: _fullParameterVehicleAvailable && joystickManager.joysticks.length !== 0
text: _forcedToButtonsOnly ? qsTr("Buttons") : qsTr("Joystick")
Layout.fillWidth: true
@@ -280,7 +280,7 @@ Rectangle {
imageResource: modelData.iconResource
setupIndicator: modelData.requiresSetup
setupComplete: modelData.setupComplete
- exclusiveGroup: setupButtonGroup
+ buttonGroup: setupButtonGroup
text: modelData.name
visible: modelData.setupSource.toString() !== ""
Layout.fillWidth: true
@@ -290,7 +290,7 @@ Rectangle {
SubMenuButton {
setupIndicator: false
- exclusiveGroup: setupButtonGroup
+ buttonGroup: setupButtonGroup
visible: QGroundControl.multiVehicleManager.parameterReadyVehicleAvailable &&
!QGroundControl.multiVehicleManager.activeVehicle.usingHighLatencyLink &&
_corePlugin.showAdvancedUI
diff --git a/src/VehicleSetup/VehicleSummary.qml b/src/VehicleSetup/VehicleSummary.qml
index 9456c09cb..31bfdd8bf 100644
--- a/src/VehicleSetup/VehicleSummary.qml
+++ b/src/VehicleSetup/VehicleSummary.qml
@@ -8,16 +8,16 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.MultiVehicleManager
+import QGroundControl.Palette
Rectangle {
id: _summaryRoot
diff --git a/src/VideoManager/VideoManager.cc b/src/VideoManager/VideoManager.cc
index fd6d90a66..698e1864c 100644
--- a/src/VideoManager/VideoManager.cc
+++ b/src/VideoManager/VideoManager.cc
@@ -16,7 +16,8 @@
#include
#ifndef QGC_DISABLE_UVC
-#include
+#include
+#include
#endif
#include "ScreenToolsController.h"
@@ -475,10 +476,10 @@ VideoManager::_updateUVC()
_uvcVideoSourceID = "";
} else {
QString videoSource = _videoSettings->videoSource()->rawValue().toString();
- QList cameras = QCameraInfo::availableCameras();
- for (const QCameraInfo &cameraInfo : cameras) {
- if (cameraInfo.description() == videoSource) {
- _uvcVideoSourceID = cameraInfo.deviceName();
+ auto videoInputs = QMediaDevices::videoInputs();
+ for (const auto& cameraDevice: videoInputs) {
+ if (cameraDevice.description() == videoSource) {
+ _uvcVideoSourceID = cameraDevice.description();
qCDebug(VideoManagerLog)
<< "Found USB source:" << _uvcVideoSourceID << " Name:" << videoSource;
break;
@@ -590,7 +591,7 @@ VideoManager::isUvc()
bool
VideoManager::uvcEnabled()
{
- return QCameraInfo::availableCameras().count() > 0;
+ return QMediaDevices::videoInputs().count() > 0;
}
#endif
diff --git a/src/VideoReceiver/VideoReceiver.pri b/src/VideoReceiver/VideoReceiver.pri
index 4d51aa902..f4c60b821 100644
--- a/src/VideoReceiver/VideoReceiver.pri
+++ b/src/VideoReceiver/VideoReceiver.pri
@@ -12,7 +12,7 @@
#
LinuxBuild {
- QT += x11extras waylandclient
+ QT += waylandclient
CONFIG += link_pkgconfig
packagesExist(gstreamer-1.0) {
PKGCONFIG += gstreamer-1.0 gstreamer-video-1.0 gstreamer-gl-1.0 egl
diff --git a/src/api/QGCCorePlugin.h b/src/api/QGCCorePlugin.h
index a6c64ddbd..791724fa3 100644
--- a/src/api/QGCCorePlugin.h
+++ b/src/api/QGCCorePlugin.h
@@ -39,6 +39,11 @@ class QGCCameraControl;
class QQuickItem;
class InstrumentValueAreaController;
+#ifndef OPAQUE_PTR_QGCCorePlugin
+ #define OPAQUE_PTR_QGCCorePlugin
+ Q_DECLARE_OPAQUE_POINTER(QGCOptions*)
+#endif
+
class QGCCorePlugin : public QGCTool
{
Q_OBJECT
diff --git a/src/comm/LinkConfiguration.h b/src/comm/LinkConfiguration.h
index 363d29b2c..e3edfee9b 100644
--- a/src/comm/LinkConfiguration.h
+++ b/src/comm/LinkConfiguration.h
@@ -15,6 +15,11 @@
class LinkInterface;
+#ifndef OPAQUE_PTR_LinkConfiguration
+ #define OPAQUE_PTR_LinkConfiguration
+ Q_DECLARE_OPAQUE_POINTER(LinkInterface*)
+#endif
+
/// Interface holding link specific settings.
class LinkConfiguration : public QObject
{
diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc
index 864ef8cd4..de6bf4e31 100644
--- a/src/comm/LinkManager.cc
+++ b/src/comm/LinkManager.cc
@@ -37,11 +37,13 @@
#include "MockLink.h"
#endif
+#ifndef QT6_DISABLE_DNSENGINE
#include
#include
#include
#include
#include
+#endif
QGC_LOGGING_CATEGORY(LinkManagerLog, "LinkManagerLog")
QGC_LOGGING_CATEGORY(LinkManagerVerboseLog, "LinkManagerVerboseLog")
@@ -430,6 +432,7 @@ void LinkManager::_addMAVLinkForwardingLink(void)
void LinkManager::_addZeroConfAutoConnectLink(void)
{
+#ifndef QT6_DISABLE_DNSENGINE
if (!_autoConnectSettings->autoConnectZeroConf()->rawValue().toBool()) {
return;
}
@@ -440,7 +443,7 @@ void LinkManager::_addZeroConfAutoConnectLink(void)
browser.reset(new QMdnsEngine::Browser(server.get(), QMdnsEngine::MdnsBrowseType));
auto checkIfConnectionLinkExist = [this](LinkConfiguration::LinkType linkType, const QString& linkName){
- for (const auto& link : qAsConst(_rgLinks)) {
+ for (const auto& link : std::as_const(_rgLinks)) {
SharedLinkConfigurationPtr linkConfig = link->linkConfiguration();
if (linkConfig->type() == linkType && linkConfig->name() == linkName) {
return true;
@@ -497,6 +500,7 @@ void LinkManager::_addZeroConfAutoConnectLink(void)
return;
}
});
+#endif
}
void LinkManager::_updateAutoConnectLinks(void)
@@ -932,4 +936,4 @@ void LinkManager::_createDynamicForwardLink(const char* linkName, QString hostNa
createConnectedLink(config);
qCDebug(LinkManagerLog) << "New dynamic MAVLink forwarding port added: " << linkName << " hostname: " << hostName;
-}
\ No newline at end of file
+}
diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc
index 93f17ba87..229dcc4ba 100644
--- a/src/comm/MAVLinkProtocol.cc
+++ b/src/comm/MAVLinkProtocol.cc
@@ -171,7 +171,7 @@ void MAVLinkProtocol::logSentBytes(LinkInterface* link, QByteArray b){
b.insert(0,QByteArray((const char*)bytes_time,sizeof(bytes_time)));
- int len = b.count();
+ int len = b.length();
if(_tempLogFile.write(b) != len)
{
diff --git a/src/comm/MockLink.cc b/src/comm/MockLink.cc
index 025662fe9..ddf9ba51d 100644
--- a/src/comm/MockLink.cc
+++ b/src/comm/MockLink.cc
@@ -563,14 +563,14 @@ void MockLink::_writeBytes(const QByteArray bytes)
void MockLink::_writeBytesQueued(const QByteArray bytes)
{
if (_inNSH) {
- _handleIncomingNSHBytes(bytes.constData(), bytes.count());
+ _handleIncomingNSHBytes(bytes.constData(), bytes.length());
} else {
if (bytes.startsWith(QByteArray("\r\r\r"))) {
_inNSH = true;
- _handleIncomingNSHBytes(&bytes.constData()[3], bytes.count() - 3);
+ _handleIncomingNSHBytes(&bytes.constData()[3], bytes.length() - 3);
}
- _handleIncomingMavlinkBytes((uint8_t *)bytes.constData(), bytes.count());
+ _handleIncomingMavlinkBytes((uint8_t *)bytes.constData(), bytes.length());
}
}
diff --git a/src/comm/MockLinkOptionsDlg.qml b/src/comm/MockLinkOptionsDlg.qml
index 079de0909..7825af2fb 100644
--- a/src/comm/MockLinkOptionsDlg.qml
+++ b/src/comm/MockLinkOptionsDlg.qml
@@ -7,21 +7,21 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Layouts 1.2
-import QtQuick.Controls 2.5
-import QtQuick.Dialogs 1.3
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Controls
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controllers
QGCPopupDialog {
title: qsTr("MockLink Options")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
property var link
diff --git a/src/comm/QGCSerialPortInfo.cc b/src/comm/QGCSerialPortInfo.cc
index ab169a308..8639177b8 100644
--- a/src/comm/QGCSerialPortInfo.cc
+++ b/src/comm/QGCSerialPortInfo.cc
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
QGC_LOGGING_CATEGORY(QGCSerialPortInfoLog, "QGCSerialPortInfoLog")
@@ -238,7 +239,7 @@ bool QGCSerialPortInfo::getBoardInfo(QGCSerialPortInfo::BoardType_t& boardType,
for (int i=0; i<_boardDescriptionFallbackList.count(); i++) {
const BoardRegExpFallback_t& boardFallback = _boardDescriptionFallbackList[i];
- if (description().contains(QRegExp(boardFallback.regExp, Qt::CaseInsensitive))) {
+ if (description().contains(QRegularExpression(boardFallback.regExp, QRegularExpression::CaseInsensitiveOption))) {
#ifndef __android
if (boardFallback.androidOnly) {
continue;
@@ -253,7 +254,7 @@ bool QGCSerialPortInfo::getBoardInfo(QGCSerialPortInfo::BoardType_t& boardType,
for (int i=0; i<_boardManufacturerFallbackList.count(); i++) {
const BoardRegExpFallback_t& boardFallback = _boardManufacturerFallbackList[i];
- if (manufacturer().contains(QRegExp(boardFallback.regExp, Qt::CaseInsensitive))) {
+ if (manufacturer().contains(QRegularExpression(boardFallback.regExp, QRegularExpression::CaseInsensitiveOption))) {
#ifndef __android
if (boardFallback.androidOnly) {
continue;
diff --git a/src/main.cc b/src/main.cc
index ec986e84a..f52e074ad 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#include "QGC.h"
#include "QGCApplication.h"
@@ -365,9 +366,9 @@ int main(int argc, char *argv[])
#endif
#endif // QT_DEBUG
- QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QGCApplication* app = new QGCApplication(argc, argv, runUnitTests);
Q_CHECK_PTR(app);
+ QQuickStyle::setStyle("Basic");
if(app->isErrorState()) {
app->exec();
return -1;
diff --git a/src/test.qml b/src/test.qml
index 988f1c5f2..737382f1a 100644
--- a/src/test.qml
+++ b/src/test.qml
@@ -1,16 +1,16 @@
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
-import QGroundControl.FactControls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.FactControls
+import QGroundControl.Palette
Rectangle {
- QGCPalette { id: palette; colorGroupEnabled: enabled }
+ QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
width: 100
height: 100
color: "#e43f3f"
- // palette.text
+ // qgcPal.text
}
diff --git a/src/ui/AppSettings.qml b/src/ui/AppSettings.qml
index ded41216b..e9f489df1 100644
--- a/src/ui/AppSettings.qml
+++ b/src/ui/AppSettings.qml
@@ -8,14 +8,14 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
Rectangle {
id: settingsView
diff --git a/src/ui/ExitWithErrorWindow.qml b/src/ui/ExitWithErrorWindow.qml
index 81abeffe0..9cd4511cc 100644
--- a/src/ui/ExitWithErrorWindow.qml
+++ b/src/ui/ExitWithErrorWindow.qml
@@ -7,11 +7,11 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.11
-import QtQuick.Window 2.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Window
ApplicationWindow {
id: errorWindow
diff --git a/src/ui/MainRootWindow.qml b/src/ui/MainRootWindow.qml
index 93274b3fc..ce4ce7796 100644
--- a/src/ui/MainRootWindow.qml
+++ b/src/ui/MainRootWindow.qml
@@ -7,18 +7,18 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Dialogs 1.3
-import QtQuick.Layouts 1.11
-import QtQuick.Window 2.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Window
-import QGroundControl 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.FlightDisplay 1.0
-import QGroundControl.FlightMap 1.0
+import QGroundControl
+import QGroundControl.Palette
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.FlightDisplay
+import QGroundControl.FlightMap
/// @brief Native QML top level window
/// All properties defined here are visible to all QML pages.
@@ -41,6 +41,13 @@ ApplicationWindow {
firstRunPromptManager.nextPrompt()
}
+ Rectangle {
+ width: 500
+ height: 500
+ anchors.left: parent.left
+ color: "red"
+ }
+
QtObject {
id: firstRunPromptManager
@@ -170,7 +177,7 @@ ApplicationWindow {
//-------------------------------------------------------------------------
//-- Global simple message dialog
- function showMessageDialog(dialogTitle, dialogText, buttons = StandardButton.Ok, acceptFunction = null) {
+ function showMessageDialog(dialogTitle, dialogText, buttons = Dialog.Ok, acceptFunction = null) {
simpleMessageDialogComponent.createObject(mainWindow, { title: dialogTitle, text: dialogText, buttons: buttons, acceptFunction: acceptFunction }).open()
}
@@ -214,7 +221,7 @@ ApplicationWindow {
if (globals.planMasterControllerPlanView && globals.planMasterControllerPlanView.dirty) {
showMessageDialog(closeDialogTitle,
qsTr("You have a mission edit in progress which has not been saved/sent. If you close you will lose changes. Are you sure you want to close?"),
- StandardButton.Yes | StandardButton.No,
+ Dialog.Yes | Dialog.No,
function() { checkForPendingParameterWrites() })
} else {
checkForPendingParameterWrites()
@@ -226,7 +233,7 @@ ApplicationWindow {
if (QGroundControl.multiVehicleManager.vehicles.get(index).parameterManager.pendingWrites) {
mainWindow.showMessageDialog(closeDialogTitle,
qsTr("You have pending parameter updates to a vehicle. If you close you will lose changes. Are you sure you want to close?"),
- StandardButton.Yes | StandardButton.No,
+ Dialog.Yes | Dialog.No,
function() { checkForActiveConnections() })
return
}
@@ -238,14 +245,14 @@ ApplicationWindow {
if (QGroundControl.multiVehicleManager.activeVehicle) {
mainWindow.showMessageDialog(closeDialogTitle,
qsTr("There are still active connections to vehicles. Are you sure you want to exit?"),
- StandardButton.Yes | StandardButton.No,
+ Dialog.Yes | Dialog.No,
function() { finishCloseProcess() })
} else {
finishCloseProcess()
}
}
- onClosing: {
+ onClosing: (close) => {
if (!_forceClose) {
close.accepted = false
checkForUnsavedMission()
@@ -283,7 +290,7 @@ ApplicationWindow {
QGCPopupDialog {
id: toolSelectDialog
title: qsTr("Select Tool")
- buttons: StandardButton.Close
+ buttons: Dialog.Close
property real _toolButtonHeight: ScreenTools.defaultFontPixelHeight * 3
property real _margins: ScreenTools.defaultFontPixelWidth
@@ -370,7 +377,8 @@ ApplicationWindow {
anchors.topMargin: -versionLabel.height
anchors.fill: parent
- onClicked: {
+ onClicked: (mouse) => {
+ console.log("clicked")
if (mouse.modifiers & Qt.ControlModifier) {
QGroundControl.corePlugin.showTouchAreas = !QGroundControl.corePlugin.showTouchAreas
showTouchAreasNotification.open()
@@ -393,17 +401,21 @@ ApplicationWindow {
id: showTouchAreasNotification
title: qsTr("Debug Touch Areas")
text: qsTr("Touch Area display toggled")
- standardButtons: StandardButton.Ok
+ buttons: MessageDialog.Ok
}
MessageDialog {
id: advancedModeOnConfirmation
title: qsTr("Advanced Mode")
text: QGroundControl.corePlugin.showAdvancedUIMessage
- standardButtons: StandardButton.Yes | StandardButton.No
- onYes: {
- QGroundControl.corePlugin.showAdvancedUI = true
- advancedModeOnConfirmation.close()
+ buttons: MessageDialog.Yes | MessageDialog.No
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ QGroundControl.corePlugin.showAdvancedUI = true
+ advancedModeOnConfirmation.close()
+ break;
+ }
}
}
@@ -411,10 +423,17 @@ ApplicationWindow {
id: advancedModeOffConfirmation
title: qsTr("Advanced Mode")
text: qsTr("Turn off Advanced Mode?")
- standardButtons: StandardButton.Yes | StandardButton.No
- onYes: {
- QGroundControl.corePlugin.showAdvancedUI = false
- advancedModeOffConfirmation.close()
+ buttons: MessageDialog.Yes | MessageDialog.No
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ QGroundControl.corePlugin.showAdvancedUI = false
+ advancedModeOffConfirmation.close()
+ break;
+ case MessageDialog.No:
+ resetPrompt.close()
+ break;
+ }
}
}
}
diff --git a/src/ui/preferences/BluetoothSettings.qml b/src/ui/preferences/BluetoothSettings.qml
index 926ce0fda..48ae2b5be 100644
--- a/src/ui/preferences/BluetoothSettings.qml
+++ b/src/ui/preferences/BluetoothSettings.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
ColumnLayout {
spacing: _rowSpacing
diff --git a/src/ui/preferences/DebugWindow.qml b/src/ui/preferences/DebugWindow.qml
index 09774e46e..08c75ebe0 100644
--- a/src/ui/preferences/DebugWindow.qml
+++ b/src/ui/preferences/DebugWindow.qml
@@ -8,17 +8,17 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
-import QtQuick.Window 2.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
+import QtQuick.Window
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.Controllers
+import QGroundControl.ScreenTools
Item {
diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml
index 1b9b9d68f..705b9820a 100644
--- a/src/ui/preferences/GeneralSettings.qml
+++ b/src/ui/preferences/GeneralSettings.qml
@@ -8,21 +8,21 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Controllers 1.0
-import QGroundControl.SettingsManager 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.MultiVehicleManager
+import QGroundControl.Palette
+import QGroundControl.Controllers
+import QGroundControl.SettingsManager
Rectangle {
id: _root
@@ -39,7 +39,7 @@ Rectangle {
property real _labelWidth: ScreenTools.defaultFontPixelWidth * 20
property real _comboFieldWidth: ScreenTools.defaultFontPixelWidth * 30
- property real _valueFieldWidth: ScreenTools.defaultFontPixelWidth * 10
+ property real _valueFieldWidth: ScreenTools.defaultFontPixelWidth * 15
property string _mapProvider: QGroundControl.settingsManager.flightMapSettings.mapProvider.value
property string _mapType: QGroundControl.settingsManager.flightMapSettings.mapType.value
property Fact _followTarget: QGroundControl.settingsManager.appSettings.followTarget
@@ -234,7 +234,6 @@ Rectangle {
id: customActionPathBrowseDialog
title: qsTr("Choose the Custom Action Definitions file")
folder: customActions.jsonFile.rawValue
- selectExisting: true
selectFolder: false
onAcceptedForLoad: customActions.jsonFile.rawValue = file
nameFilters: ["JSON files (*.json)"]
@@ -709,17 +708,21 @@ Rectangle {
MessageDialog {
id: clearDialog
visible: false
- icon: StandardIcon.Warning
- standardButtons: StandardButton.Yes | StandardButton.No
+ //icon: StandardIcon.Warning
+ buttons: MessageDialog.Yes | MessageDialog.No
title: qsTr("Clear Settings")
text: qsTr("All saved settings will be reset the next time you start %1. Is this really what you want?").arg(QGroundControl.appName)
- onYes: {
- QGroundControl.deleteAllSettingsNextBoot()
- clearDialog.visible = false
- }
- onNo: {
- clearCheck.checked = false
- clearDialog.visible = false
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ QGroundControl.deleteAllSettingsNextBoot()
+ //clearDialog.visible = false
+ break;
+ case MessageDialog.No:
+ clearCheck.checked = false
+ //clearDialog.visible = false
+ break;
+ }
}
}
}
@@ -755,7 +758,6 @@ Rectangle {
id: savePathBrowseDialog
title: qsTr("Choose the location to save/load files")
folder: _savePath.rawValue
- selectExisting: true
selectFolder: true
onAcceptedForLoad: _savePath.rawValue = file
}
@@ -1159,7 +1161,6 @@ Rectangle {
id: userBrandImageIndoorBrowseDialog
title: qsTr("Choose custom brand image file")
folder: _userBrandImageIndoor.rawValue.replace("file:///","")
- selectExisting: true
selectFolder: false
onAcceptedForLoad: _userBrandImageIndoor.rawValue = "file:///" + file
}
@@ -1181,7 +1182,6 @@ Rectangle {
id: userBrandImageOutdoorBrowseDialog
title: qsTr("Choose custom brand image file")
folder: _userBrandImageOutdoor.rawValue.replace("file:///","")
- selectExisting: true
selectFolder: false
onAcceptedForLoad: _userBrandImageOutdoor.rawValue = "file:///" + file
}
diff --git a/src/ui/preferences/HelpSettings.qml b/src/ui/preferences/HelpSettings.qml
index 9fd988c3c..e35184dbd 100644
--- a/src/ui/preferences/HelpSettings.qml
+++ b/src/ui/preferences/HelpSettings.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Rectangle {
color: qgcPal.window
diff --git a/src/ui/preferences/LinkSettings.qml b/src/ui/preferences/LinkSettings.qml
index 0a3a27e48..2f2ce0745 100644
--- a/src/ui/preferences/LinkSettings.qml
+++ b/src/ui/preferences/LinkSettings.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
Rectangle {
id: _linkRoot
@@ -100,17 +100,23 @@ Rectangle {
MessageDialog {
id: deleteDialog
visible: false
- icon: StandardIcon.Warning
- standardButtons: StandardButton.Yes | StandardButton.No
+ //icon: StandardIcon.Warning
+ buttons: MessageDialog.Yes | MessageDialog.No
title: qsTr("Remove Link Configuration")
text: _currentSelection ? qsTr("Remove %1. Is this really what you want?").arg(_currentSelection.name) : ""
- onYes: {
- QGroundControl.linkManager.removeConfiguration(_currentSelection)
- _currentSelection = null
- deleteDialog.visible = false
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ QGroundControl.linkManager.removeConfiguration(_currentSelection)
+ _currentSelection = null
+ deleteDialog.visible = false
+ break;
+ case MessageDialog.No:
+ deleteDialog.visible = false
+ break;
+ }
}
- onNo: deleteDialog.visible = false
}
}
QGCButton {
diff --git a/src/ui/preferences/LogReplaySettings.qml b/src/ui/preferences/LogReplaySettings.qml
index c44454923..61da20f3d 100644
--- a/src/ui/preferences/LogReplaySettings.qml
+++ b/src/ui/preferences/LogReplaySettings.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
RowLayout {
spacing: _colSpacing
@@ -40,9 +40,8 @@ RowLayout {
id: filePicker
title: qsTr("Select Telemetery Log")
nameFilters: [ qsTr("Telemetry Logs (*.%1)").arg(_logFileExtension), qsTr("All Files (*)") ]
- selectExisting: true
folder: QGroundControl.settingsManager.appSettings.telemetrySavePath
- onAcceptedForLoad: {
+ onAcceptedForLoad: (file) => {
logField.text = file
close()
}
diff --git a/src/ui/preferences/MavlinkSettings.qml b/src/ui/preferences/MavlinkSettings.qml
index 8174d8232..9fbe38b01 100644
--- a/src/ui/preferences/MavlinkSettings.qml
+++ b/src/ui/preferences/MavlinkSettings.qml
@@ -8,19 +8,19 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.MultiVehicleManager
+import QGroundControl.Palette
Rectangle {
id: __mavlinkRoot
@@ -80,8 +80,8 @@ Rectangle {
MessageDialog {
id: emptyEmailDialog
visible: false
- icon: StandardIcon.Warning
- standardButtons: StandardButton.Close
+ //icon: StandardIcon.Warning
+ buttons: MessageDialog.Close
title: qsTr("MAVLink Logging")
text: qsTr("Please enter an email address before uploading MAVLink log files.")
}
@@ -622,14 +622,11 @@ Rectangle {
id: feedbackTextArea
width: _valueWidth
height: ScreenTools.defaultFontPixelHeight * 4
- frameVisible: false
font.pointSize: ScreenTools.defaultFontPointSize
text: QGroundControl.mavlinkLogManager.feedback
enabled: !_disableDataPersistence
- style: TextAreaStyle {
- textColor: qgcPal.textFieldText
- backgroundColor: qgcPal.textField
- }
+ color: qgcPal.textFieldText
+ background: Rectangle { color: qgcPal.textField }
}
}
//-----------------------------------------------------------------
@@ -751,8 +748,8 @@ Rectangle {
width: ScreenTools.defaultFontPixelWidth * 20;
height: ScreenTools.defaultFontPixelHeight
anchors.verticalCenter: parent.verticalCenter
- minimumValue: 0
- maximumValue: 100
+ from: 0
+ to: 100
value: object.progress * 100.0
}
}
@@ -789,12 +786,16 @@ Rectangle {
MessageDialog {
id: deleteDialog
visible: false
- icon: StandardIcon.Warning
- standardButtons: StandardButton.Yes | StandardButton.No
+ //icon: StandardIcon.Warning
+ buttons: MessageDialog.Yes | MessageDialog.No
title: qsTr("Delete Selected Log Files")
text: qsTr("Confirm deleting selected log files?")
- onYes: {
- QGroundControl.mavlinkLogManager.deleteLog()
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ QGroundControl.mavlinkLogManager.deleteLog()
+ break;
+ }
}
}
}
@@ -812,12 +813,16 @@ Rectangle {
MessageDialog {
id: uploadDialog
visible: false
- icon: StandardIcon.Question
- standardButtons: StandardButton.Yes | StandardButton.No
+ //icon: StandardIcon.Question
+ buttons: MessageDialog.Yes | MessageDialog.No
title: qsTr("Upload Selected Log Files")
text: qsTr("Confirm uploading selected log files?")
- onYes: {
- QGroundControl.mavlinkLogManager.uploadLog()
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ QGroundControl.mavlinkLogManager.uploadLog()
+ break;
+ }
}
}
}
@@ -829,12 +834,16 @@ Rectangle {
MessageDialog {
id: cancelDialog
visible: false
- icon: StandardIcon.Warning
- standardButtons: StandardButton.Yes | StandardButton.No
+ //icon: StandardIcon.Warning
+ buttons: MessageDialog.Yes | MessageDialog.No
title: qsTr("Cancel Upload")
text: qsTr("Confirm canceling the upload process?")
- onYes: {
- QGroundControl.mavlinkLogManager.cancelUpload()
+ onButtonClicked: function (button, role) {
+ switch (button) {
+ case MessageDialog.Yes:
+ QGroundControl.mavlinkLogManager.cancelUpload()
+ break;
+ }
}
}
}
diff --git a/src/ui/preferences/MockLink.qml b/src/ui/preferences/MockLink.qml
index 5c5a475d6..6f880ef07 100644
--- a/src/ui/preferences/MockLink.qml
+++ b/src/ui/preferences/MockLink.qml
@@ -8,14 +8,14 @@
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.ScreenTools
Rectangle {
color: qgcPal.window
diff --git a/src/ui/preferences/MockLinkSettings.qml b/src/ui/preferences/MockLinkSettings.qml
index 498e0a560..aa7ffe96a 100644
--- a/src/ui/preferences/MockLinkSettings.qml
+++ b/src/ui/preferences/MockLinkSettings.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
GridLayout {
columns: 2
diff --git a/src/ui/preferences/RemoteIDSettings.qml b/src/ui/preferences/RemoteIDSettings.qml
index 11f723f14..6a2207ebf 100644
--- a/src/ui/preferences/RemoteIDSettings.qml
+++ b/src/ui/preferences/RemoteIDSettings.qml
@@ -7,19 +7,19 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.4
-import QtQuick.Dialogs 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls
+import QtQuick.Dialogs
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.FactControls 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.FactSystem
+import QGroundControl.FactControls
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.MultiVehicleManager
+import QGroundControl.Palette
Rectangle {
id: remoteIDRoot
diff --git a/src/ui/preferences/SerialSettings.qml b/src/ui/preferences/SerialSettings.qml
index 55001230c..09d9555ba 100644
--- a/src/ui/preferences/SerialSettings.qml
+++ b/src/ui/preferences/SerialSettings.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
ColumnLayout {
spacing: _rowSpacing
diff --git a/src/ui/preferences/TcpSettings.qml b/src/ui/preferences/TcpSettings.qml
index edfd826cb..8ff7fe688 100644
--- a/src/ui/preferences/TcpSettings.qml
+++ b/src/ui/preferences/TcpSettings.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
GridLayout {
columns: 2
diff --git a/src/ui/preferences/UdpSettings.qml b/src/ui/preferences/UdpSettings.qml
index e6d30bbba..0df2b0d52 100644
--- a/src/ui/preferences/UdpSettings.qml
+++ b/src/ui/preferences/UdpSettings.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
ColumnLayout {
spacing: _rowSpacing
diff --git a/src/ui/toolbar/APMSupportForwardingIndicator.qml b/src/ui/toolbar/APMSupportForwardingIndicator.qml
index 91e1a4ae6..22f724067 100644
--- a/src/ui/toolbar/APMSupportForwardingIndicator.qml
+++ b/src/ui/toolbar/APMSupportForwardingIndicator.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- Telemetry RSSI
diff --git a/src/ui/toolbar/ArmedIndicator.qml b/src/ui/toolbar/ArmedIndicator.qml
index 02d7d55c0..3eea59d56 100644
--- a/src/ui/toolbar/ArmedIndicator.qml
+++ b/src/ui/toolbar/ArmedIndicator.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- Armed Indicator
diff --git a/src/ui/toolbar/BatteryIndicator.qml b/src/ui/toolbar/BatteryIndicator.qml
index 9d68fc3c7..075896582 100644
--- a/src/ui/toolbar/BatteryIndicator.qml
+++ b/src/ui/toolbar/BatteryIndicator.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import MAVLink 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import MAVLink
//-------------------------------------------------------------------------
//-- Battery Indicator
diff --git a/src/ui/toolbar/FlightModeMenuIndicator.qml b/src/ui/toolbar/FlightModeMenuIndicator.qml
index 5ac65c808..0210a41f7 100644
--- a/src/ui/toolbar/FlightModeMenuIndicator.qml
+++ b/src/ui/toolbar/FlightModeMenuIndicator.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
Item {
id: _root
diff --git a/src/ui/toolbar/GPSIndicator.qml b/src/ui/toolbar/GPSIndicator.qml
index 881285c66..2b6290ebf 100644
--- a/src/ui/toolbar/GPSIndicator.qml
+++ b/src/ui/toolbar/GPSIndicator.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- GPS Indicator
diff --git a/src/ui/toolbar/GPSRTKIndicator.qml b/src/ui/toolbar/GPSRTKIndicator.qml
index 5af55983a..664f0da61 100644
--- a/src/ui/toolbar/GPSRTKIndicator.qml
+++ b/src/ui/toolbar/GPSRTKIndicator.qml
@@ -7,13 +7,13 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- GPS Indicator
diff --git a/src/ui/toolbar/JoystickIndicator.qml b/src/ui/toolbar/JoystickIndicator.qml
index 060cb9450..b405dcd07 100644
--- a/src/ui/toolbar/JoystickIndicator.qml
+++ b/src/ui/toolbar/JoystickIndicator.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
// Joystick Indicator
Item {
diff --git a/src/ui/toolbar/LinkIndicator.qml b/src/ui/toolbar/LinkIndicator.qml
index 433e17c93..4c26b862b 100644
--- a/src/ui/toolbar/LinkIndicator.qml
+++ b/src/ui/toolbar/LinkIndicator.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.Vehicle 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.Vehicle
Item {
anchors.top: parent.top
diff --git a/src/ui/toolbar/MainStatusIndicator.qml b/src/ui/toolbar/MainStatusIndicator.qml
index 1e2ff5f2c..adca7915e 100644
--- a/src/ui/toolbar/MainStatusIndicator.qml
+++ b/src/ui/toolbar/MainStatusIndicator.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.FactSystem 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
+import QGroundControl.FactSystem
RowLayout {
id: _root
diff --git a/src/ui/toolbar/MainToolBar.qml b/src/ui/toolbar/MainToolBar.qml
index 9a183ffd2..d0b1cc9a3 100644
--- a/src/ui/toolbar/MainToolBar.qml
+++ b/src/ui/toolbar/MainToolBar.qml
@@ -7,17 +7,17 @@
*
****************************************************************************/
-import QtQuick 2.12
-import QtQuick.Controls 2.4
-import QtQuick.Layouts 1.11
-import QtQuick.Dialogs 1.3
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import QtQuick.Dialogs
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Controllers 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.Palette
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Controllers
Rectangle {
id: _root
diff --git a/src/ui/toolbar/MainToolBarIndicators.qml b/src/ui/toolbar/MainToolBarIndicators.qml
index 7a384a4de..72aced485 100644
--- a/src/ui/toolbar/MainToolBarIndicators.qml
+++ b/src/ui/toolbar/MainToolBarIndicators.qml
@@ -7,10 +7,10 @@
*
****************************************************************************/
-import QtQuick 2.12
+import QtQuick
-import QGroundControl 1.0
-import QGroundControl.ScreenTools 1.0
+import QGroundControl
+import QGroundControl.ScreenTools
//-------------------------------------------------------------------------
//-- Toolbar Indicators
diff --git a/src/ui/toolbar/MessageIndicator.qml b/src/ui/toolbar/MessageIndicator.qml
index 6bb0e56f1..bf55a38e4 100644
--- a/src/ui/toolbar/MessageIndicator.qml
+++ b/src/ui/toolbar/MessageIndicator.qml
@@ -8,16 +8,16 @@
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.FactSystem 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.FactSystem
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- Message Indicator
diff --git a/src/ui/toolbar/ModeIndicator.qml b/src/ui/toolbar/ModeIndicator.qml
index 75dcf7a43..e20220efc 100644
--- a/src/ui/toolbar/ModeIndicator.qml
+++ b/src/ui/toolbar/ModeIndicator.qml
@@ -8,14 +8,14 @@
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- Mode Indicator
diff --git a/src/ui/toolbar/MultiVehicleSelector.qml b/src/ui/toolbar/MultiVehicleSelector.qml
index 1dea9a5bc..191fac08b 100644
--- a/src/ui/toolbar/MultiVehicleSelector.qml
+++ b/src/ui/toolbar/MultiVehicleSelector.qml
@@ -8,14 +8,14 @@
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick
+import QtQuick.Controls
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- Multiple Vehicle Selector
diff --git a/src/ui/toolbar/RCRSSIIndicator.qml b/src/ui/toolbar/RCRSSIIndicator.qml
index a4bf7dd6d..8e78ebba4 100644
--- a/src/ui/toolbar/RCRSSIIndicator.qml
+++ b/src/ui/toolbar/RCRSSIIndicator.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- RC RSSI Indicator
diff --git a/src/ui/toolbar/ROIIndicator.qml b/src/ui/toolbar/ROIIndicator.qml
index a5d1b13f2..90e60dca7 100644
--- a/src/ui/toolbar/ROIIndicator.qml
+++ b/src/ui/toolbar/ROIIndicator.qml
@@ -9,15 +9,15 @@
* @author Gus Grubba
*/
-import QtQuick 2.11
-import QtQuick.Controls 1.4
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- ROI Indicator
diff --git a/src/ui/toolbar/RemoteIDIndicator.qml b/src/ui/toolbar/RemoteIDIndicator.qml
index 26e29f647..d293501fc 100644
--- a/src/ui/toolbar/RemoteIDIndicator.qml
+++ b/src/ui/toolbar/RemoteIDIndicator.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- Remote ID Indicator
diff --git a/src/ui/toolbar/SignalStrength.qml b/src/ui/toolbar/SignalStrength.qml
index f20fd436a..17dd71b4c 100644
--- a/src/ui/toolbar/SignalStrength.qml
+++ b/src/ui/toolbar/SignalStrength.qml
@@ -14,10 +14,10 @@
* @author Gus Grubba
*/
-import QtQuick 2.3
+import QtQuick
-import QGroundControl.Controls 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl.Controls
+import QGroundControl.Palette
Item {
id: signalRoot
diff --git a/src/ui/toolbar/TelemetryRSSIIndicator.qml b/src/ui/toolbar/TelemetryRSSIIndicator.qml
index b51a392b2..ea42cfc6e 100644
--- a/src/ui/toolbar/TelemetryRSSIIndicator.qml
+++ b/src/ui/toolbar/TelemetryRSSIIndicator.qml
@@ -7,14 +7,14 @@
*
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Layouts 1.11
+import QtQuick
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- Telemetry RSSI
diff --git a/src/ui/toolbar/VTOLModeIndicator.qml b/src/ui/toolbar/VTOLModeIndicator.qml
index 1282bd33c..4d622525d 100644
--- a/src/ui/toolbar/VTOLModeIndicator.qml
+++ b/src/ui/toolbar/VTOLModeIndicator.qml
@@ -7,15 +7,15 @@
*
****************************************************************************/
-import QtQuick 2.3
-import QtQuick.Controls 1.2
-import QtQuick.Layouts 1.2
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
-import QGroundControl 1.0
-import QGroundControl.Controls 1.0
-import QGroundControl.MultiVehicleManager 1.0
-import QGroundControl.ScreenTools 1.0
-import QGroundControl.Palette 1.0
+import QGroundControl
+import QGroundControl.Controls
+import QGroundControl.MultiVehicleManager
+import QGroundControl.ScreenTools
+import QGroundControl.Palette
//-------------------------------------------------------------------------
//-- VTOL Mode Indicator