Skip to content

Commit

Permalink
upgrade qml 5.15 to 6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Oct 12, 2024
1 parent e2c8973 commit 0d21811
Show file tree
Hide file tree
Showing 46 changed files with 82 additions and 85 deletions.
1 change: 0 additions & 1 deletion gui/controls2_640/Banner.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import Osmin 1.0

Page {
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/ConfigureMap.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import Osmin 1.0
import "./components"
import "../toolbox.js" as ToolBox
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/ConfigureVoice.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import QtQml.Models 2.3
import Osmin 1.0
import "./components"
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/DialogAbout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import Osmin 1.0
import "./components"

Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/Favorites.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import QtQml.Models 2.3
import Osmin 1.0
import "./components"
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/LocationInfo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import Osmin 1.0
import "./components"

Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/MainMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import QtQml.Models 2.3
import "./components"
import "../toolbox.js" as ToolBox
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/MapDownloads.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import QtQml.Models 2.3
import Osmin 1.0
import "./components"
Expand Down
49 changes: 31 additions & 18 deletions gui/controls2_640/MapView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtQml 2.2
import Osmin 1.0
import "./components"
import "../toolbox.js" as ToolBox
Expand Down Expand Up @@ -94,7 +93,7 @@ MapPage {
// configure style from setting
var flags = JSON.parse(settings.styleFlags);
if (Array.isArray(flags)) {
flags.push({ "name": "daylight", "value": !nightView });
flags.push({ "name": "daylight", "value": MapExtras.dayLight });
setStyleFlags(flags);
}

Expand All @@ -111,7 +110,6 @@ MapPage {
property double lon: 0.0
}

property bool nightView: false
property bool rotateEnabled: false
property real rotation: 0.0 // rotation of the map (radians)
property bool lockRotation: true // lock or unlock rotation of the map
Expand Down Expand Up @@ -334,7 +332,7 @@ MapPage {
ScaleIndicator{
id: scaleIndicator
pixelSize: map.pixelSize
color: "black"
color: MapExtras.dayLight ? "black" : "lightGray"
visible: !showToolbar
anchors{
bottom: parent.bottom
Expand All @@ -351,7 +349,7 @@ MapPage {
text: "© OpenStreetMap contributors"
font.pixelSize: units.fs("x-small")
font.weight: Font.Thin
color: nightView ? "white" : "black"
color: MapExtras.dayLight ? "black" : "white"
visible: !showToolbar && !navigation
}

Expand Down Expand Up @@ -483,27 +481,27 @@ MapPage {
id: currentSpeed
text: Converter.readableSpeed(Tracker.currentSpeed)
font.pixelSize: 1.5 * units.fs("x-large")
color: nightView ? "white" : "black"
color: MapExtras.dayLight ? "black" : "white"
}
Row {
spacing: units.gu(2)
Label {
id: duration
text: Converter.panelDurationHMS(Tracker.duration)
font.pixelSize: units.fs("medium")
color: nightView ? "white" : "black"
color: MapExtras.dayLight ? "black" : "white"
}
Label {
id: distance
text: Converter.panelDistance(Tracker.distance)
font.pixelSize: units.fs("medium")
color: nightView ? "white" : "black"
color: MapExtras.dayLight ? "black" : "white"
}
}
MapIcon {
id: elevation
source: "qrc:/images/trip/elevation.svg"
color: nightView ? "white" : "black"
color: MapExtras.dayLight ? "black" : "white"
enabled: false
height: units.gu(2)
borderPadding: 0
Expand Down Expand Up @@ -786,8 +784,7 @@ MapPage {
opacity: 0.7
height: units.gu(6)
onClicked: {
nightView = !nightView;
MapExtras.setDaylight(!nightView);
MapExtras.setDaylight(!MapExtras.dayLight);
}
}
}
Expand Down Expand Up @@ -929,8 +926,7 @@ MapPage {
opacity: 0.7
height: units.gu(6)
onClicked: {
nightView = !nightView;
map.toggleDaylight();
MapExtras.setDaylight(!MapExtras.dayLight);
}
}
}
Expand Down Expand Up @@ -1129,7 +1125,7 @@ MapPage {
popNavigatorInfo.visible = Qt.binding(function() { return mapView.state === "view"; });
}

onTargetReached: {
onTargetReached: function(targetDistance, targetBearing) {
popInfo.open(qsTr("Target reached at %1 %2.").arg(Converter.readableDistance(targetDistance)).arg(Converter.readableBearing(targetBearing)));
}
}
Expand Down Expand Up @@ -1165,12 +1161,29 @@ MapPage {
}
}

property QtObject suspendedState: QtObject {
property bool navigation: false
}

Connections {
target: mainView
function onApplicationSuspendedChanged() {
// On android disable navigation when the app is suspended
if (DeviceMobile && applicationSuspended && navigation)
navigation = false;
// On device mobile (e.g Android) disable all when the app is suspended
if (DeviceMobile) {
if (applicationSuspended) {
rotateEnabled = false;
map.lockToPosition = false;
// save current state
suspendedState.navigation = navigation;
// disable navigation state
if (navigation)
navigation = false;
} else {
// restore navigation state
if (suspendedState.navigation)
navigation = true;
}
}
}
function onShowFavoritesChanged() {
if (showFavorites)
Expand Down Expand Up @@ -1264,7 +1277,7 @@ MapPage {
if (Service.status === Service.ServiceConnected) {
popInfo.open(qsTr("Tracker service is connected"), "limegreen", "black");
// clear all data before ping ALL
Tracker.magneticDip = settings.magneticDip;
mainView.flipAzimuth(settings.magneticDip);
overlayManager.removeRecording();
overlayManager.removeMark(1);
overlayRecording.clear();
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/Routing.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import QtQml.Models 2.3
import Osmin 1.0
import "./components"
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/SearchPlace.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import Osmin 1.0
import "./components"
import "../toolbox.js" as ToolBox
Expand Down
9 changes: 4 additions & 5 deletions gui/controls2_640/Settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import QtQml.Models 2.3
import QtQuick.Layouts 1.3
import Osmin 1.0
Expand Down Expand Up @@ -204,9 +203,9 @@ MapPage {
}
SpinBox {
id: magdipBox
from: -300
from: -1800
value: settings.magneticDip * 10
to: 300
to: 1800
stepSize: 10
font.pixelSize: units.fs("medium");
Layout.fillWidth: true
Expand All @@ -230,8 +229,8 @@ MapPage {
onValueModified: {
// save settings
settings.magneticDip = realValue;
// setup tracker
Tracker.magneticDip = realValue;
// reconfigure azimuth
mainView.flipAzimuth(realValue);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/TrackCollection.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import QtQml.Models 2.3
import Osmin 1.0
import "./components"
Expand Down
17 changes: 12 additions & 5 deletions gui/controls2_640/Tracking.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import Osmin 1.0
import "./components"

Expand Down Expand Up @@ -223,10 +222,18 @@ PopOver {
color: styleMap.popover.highlightedColor
font.pixelSize: units.fs("medium")
}
Label {
text: Converter.readableDegreeGeocaching(180.0 * Tracker.bearing / Math.PI)
font.pixelSize: units.fs("large")
color: foregroundColor
Row {
spacing: units.gu(1)
Label {
text: Converter.readableDegree(180.0 * Tracker.bearing / Math.PI)
font.pixelSize: units.fs("large")
color: foregroundColor
}
Label {
text: "(" + Converter.readableCardinal(180.0 * Tracker.bearing / Math.PI) + ")"
font.pixelSize: units.fs("large")
color: foregroundColor
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/Welcome.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import "./components"

MapPage {
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/ActivitySpinner.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2

Item {
id: loading
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/CompassSensor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

import QtQuick 2.0
import QtQml 2.2
//import QtSensors 5.2 as Legacy
import Osmin 1.0 as Osmin

Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/DialogAction.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2

DialogBase {
id: dialog
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/DialogAlert.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2

DialogBase {
id: dialog
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/DialogBase.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2

Dialog {
id: dialog
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/DialogEnter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2

DialogBase {
id: dialog
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/DialogMarkPosition.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2

DialogBase {
id: dialog
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/MapCheckBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.2
import QtQuick.Controls 2.2
import QtQml 2.2

Item {
id: control
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/MapIcon.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2
import Qt5Compat.GraphicalEffects 6.0

MouseArea {
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/MapListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQml 2.2

ListView {
Component.onCompleted: {
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/MapPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtQml 2.2

// generic page for map
Page {
Expand Down
1 change: 0 additions & 1 deletion gui/controls2_640/components/MapRotator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

import QtQuick 2.2
import QtQml 2.2
import Osmin 1.0

Item {
Expand Down
Loading

0 comments on commit 0d21811

Please sign in to comment.