Skip to content

Commit

Permalink
Work around Qt Bug QTBUG-54552
Browse files Browse the repository at this point in the history
  • Loading branch information
gschwann committed Nov 2, 2016
1 parent 087211b commit b08753c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
4 changes: 0 additions & 4 deletions src/MapComponent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,14 @@ BaseView {
property MarkerLabel markerLabel

readonly property int markerSize: Theme.buttonHeight / map.scale
readonly property real defaultZoomLevel: 16

center: QtPositioning.coordinate(47.0666667, 15.45)
onCenterChanged: {
if (autoUpdatePois) {
markerLoader.setLocation(center.latitude, center.longitude);
}
appCore.currentMapPosition = center;
}

zoomLevel: defaultZoomLevel

onZoomLevelChanged: {
root.updateRadius();
}
Expand Down
25 changes: 14 additions & 11 deletions src/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ Item {
}
}

// PositionSource
property variant locationGraz: QtPositioning.coordinate(47.0666667, 15.45)

Loader {
id: shutDownDialog

Expand Down Expand Up @@ -272,17 +269,16 @@ Item {

visible: parent.splitScreen || !details.visible

Settings {
id: settings
property alias lastSeenLat: mapOfEurope.center.latitude
property alias lastSeenLon: mapOfEurope.center.longitude
property alias lastZoomLevel: mapOfEurope.zoomLevel
}

center: locationGraz
center: QtPositioning.coordinate(settings.lastSeenLat, settings.lastSeenLon)
zoomLevel: settings.lastZoomLevel
Component.onCompleted: {
root.mainMap = mapOfEurope;
}
Component.onDestruction: {
settings.lastSeenLat = mapOfEurope.center.latitude
settings.lastSeenLon = mapOfEurope.center.longitude
settings.lastZoomLevel = mapOfEurope.zoomLevel
}
}

Loader {
Expand Down Expand Up @@ -321,4 +317,11 @@ Item {
}
}
}

Settings {
id: settings
property double lastSeenLat: 47.0666667 // graz
property double lastSeenLon: 15.45
property double lastZoomLevel: 16 // default zoom level
}
}

0 comments on commit b08753c

Please sign in to comment.