diff options
author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-05-15 12:33:40 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-06-15 16:37:32 +0000 |
commit | fa9f630dc0e632ddcb30b3145afec4a7c4b2e192 (patch) | |
tree | 6630403f4e36ea56cd7efc2c0dbe0da42dfe4ad8 | |
parent | a2572b64ed3bdadc7ccdc86447bd05e28834c05f (diff) |
mapviewer example: QML revamp
- Modifications as per c252ae7abf81a07649c05cafc76324179ea8a18e
Task-number: PYSIDE-2206
Change-Id: I6580e7ae44ee17dd3526059f0963a0f45fcb344f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 9c7f990f8d2d71650b11c6913c4d7c4118eccad6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | examples/location/mapviewer/MapViewer/Main.qml (renamed from examples/location/mapviewer/mapviewer.qml) | 4 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/Geocode.qml (renamed from examples/location/mapviewer/forms/Geocode.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/GeocodeForm.ui.qml (renamed from examples/location/mapviewer/forms/GeocodeForm.ui.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/Locale.qml (renamed from examples/location/mapviewer/forms/Locale.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/LocaleForm.ui.qml (renamed from examples/location/mapviewer/forms/LocaleForm.ui.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/Message.qml (renamed from examples/location/mapviewer/forms/Message.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/MessageForm.ui.qml (renamed from examples/location/mapviewer/forms/MessageForm.ui.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/ReverseGeocode.qml (renamed from examples/location/mapviewer/forms/ReverseGeocode.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/ReverseGeocodeForm.ui.qml (renamed from examples/location/mapviewer/forms/ReverseGeocodeForm.ui.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/RouteAddress.qml (renamed from examples/location/mapviewer/forms/RouteAddress.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/RouteAddressForm.ui.qml (renamed from examples/location/mapviewer/forms/RouteAddressForm.ui.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/RouteCoordinate.qml (renamed from examples/location/mapviewer/forms/RouteCoordinate.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/RouteCoordinateForm.ui.qml (renamed from examples/location/mapviewer/forms/RouteCoordinateForm.ui.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/RouteList.qml (renamed from examples/location/mapviewer/forms/RouteList.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/RouteListDelegate.qml (renamed from examples/location/mapviewer/forms/RouteListDelegate.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/forms/RouteListHeader.qml (renamed from examples/location/mapviewer/forms/RouteListHeader.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/helper.js (renamed from examples/location/mapviewer/helper.js) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/map/MapComponent.qml (renamed from examples/location/mapviewer/map/MapComponent.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/map/MapSliders.qml (renamed from examples/location/mapviewer/map/MapSliders.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/map/Marker.qml (renamed from examples/location/mapviewer/map/Marker.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/map/MiniMap.qml (renamed from examples/location/mapviewer/map/MiniMap.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/menus/ItemPopupMenu.qml (renamed from examples/location/mapviewer/menus/ItemPopupMenu.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/menus/MainMenu.qml (renamed from examples/location/mapviewer/menus/MainMenu.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/menus/MapPopupMenu.qml (renamed from examples/location/mapviewer/menus/MapPopupMenu.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/menus/MarkerPopupMenu.qml (renamed from examples/location/mapviewer/menus/MarkerPopupMenu.qml) | 0 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/qmldir | 27 | ||||
-rw-r--r-- | examples/location/mapviewer/MapViewer/resources/marker.png (renamed from examples/location/mapviewer/resources/marker.png) | bin | 752 -> 752 bytes | |||
-rw-r--r-- | examples/location/mapviewer/MapViewer/resources/marker_blue.png (renamed from examples/location/mapviewer/resources/marker_blue.png) | bin | 3523 -> 3523 bytes | |||
-rw-r--r-- | examples/location/mapviewer/MapViewer/resources/scale.png (renamed from examples/location/mapviewer/resources/scale.png) | bin | 98 -> 98 bytes | |||
-rw-r--r-- | examples/location/mapviewer/MapViewer/resources/scale_end.png (renamed from examples/location/mapviewer/resources/scale_end.png) | bin | 93 -> 93 bytes | |||
-rw-r--r-- | examples/location/mapviewer/main.py | 7 | ||||
-rw-r--r-- | examples/location/mapviewer/mapviewer.pyproject | 54 |
32 files changed, 61 insertions, 31 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/MapViewer/Main.qml index daa28d763..f4ae7ea04 100644 --- a/examples/location/mapviewer/mapviewer.qml +++ b/examples/location/mapviewer/MapViewer/Main.qml @@ -5,9 +5,7 @@ import QtQuick import QtQuick.Controls import QtLocation import QtPositioning -import "map" -import "menus" -import "helper.js" as Helper +import MapViewer ApplicationWindow { id: appWindow diff --git a/examples/location/mapviewer/forms/Geocode.qml b/examples/location/mapviewer/MapViewer/forms/Geocode.qml index 885357dd3..885357dd3 100644 --- a/examples/location/mapviewer/forms/Geocode.qml +++ b/examples/location/mapviewer/MapViewer/forms/Geocode.qml diff --git a/examples/location/mapviewer/forms/GeocodeForm.ui.qml b/examples/location/mapviewer/MapViewer/forms/GeocodeForm.ui.qml index cb56370ea..cb56370ea 100644 --- a/examples/location/mapviewer/forms/GeocodeForm.ui.qml +++ b/examples/location/mapviewer/MapViewer/forms/GeocodeForm.ui.qml diff --git a/examples/location/mapviewer/forms/Locale.qml b/examples/location/mapviewer/MapViewer/forms/Locale.qml index 9ba7dd7f0..9ba7dd7f0 100644 --- a/examples/location/mapviewer/forms/Locale.qml +++ b/examples/location/mapviewer/MapViewer/forms/Locale.qml diff --git a/examples/location/mapviewer/forms/LocaleForm.ui.qml b/examples/location/mapviewer/MapViewer/forms/LocaleForm.ui.qml index 9e1ec1807..9e1ec1807 100644 --- a/examples/location/mapviewer/forms/LocaleForm.ui.qml +++ b/examples/location/mapviewer/MapViewer/forms/LocaleForm.ui.qml diff --git a/examples/location/mapviewer/forms/Message.qml b/examples/location/mapviewer/MapViewer/forms/Message.qml index 583bc2dda..583bc2dda 100644 --- a/examples/location/mapviewer/forms/Message.qml +++ b/examples/location/mapviewer/MapViewer/forms/Message.qml diff --git a/examples/location/mapviewer/forms/MessageForm.ui.qml b/examples/location/mapviewer/MapViewer/forms/MessageForm.ui.qml index 426c72757..426c72757 100644 --- a/examples/location/mapviewer/forms/MessageForm.ui.qml +++ b/examples/location/mapviewer/MapViewer/forms/MessageForm.ui.qml diff --git a/examples/location/mapviewer/forms/ReverseGeocode.qml b/examples/location/mapviewer/MapViewer/forms/ReverseGeocode.qml index 31122a2e9..31122a2e9 100644 --- a/examples/location/mapviewer/forms/ReverseGeocode.qml +++ b/examples/location/mapviewer/MapViewer/forms/ReverseGeocode.qml diff --git a/examples/location/mapviewer/forms/ReverseGeocodeForm.ui.qml b/examples/location/mapviewer/MapViewer/forms/ReverseGeocodeForm.ui.qml index 1d937ee90..1d937ee90 100644 --- a/examples/location/mapviewer/forms/ReverseGeocodeForm.ui.qml +++ b/examples/location/mapviewer/MapViewer/forms/ReverseGeocodeForm.ui.qml diff --git a/examples/location/mapviewer/forms/RouteAddress.qml b/examples/location/mapviewer/MapViewer/forms/RouteAddress.qml index 3676c1374..3676c1374 100644 --- a/examples/location/mapviewer/forms/RouteAddress.qml +++ b/examples/location/mapviewer/MapViewer/forms/RouteAddress.qml diff --git a/examples/location/mapviewer/forms/RouteAddressForm.ui.qml b/examples/location/mapviewer/MapViewer/forms/RouteAddressForm.ui.qml index ee9227013..ee9227013 100644 --- a/examples/location/mapviewer/forms/RouteAddressForm.ui.qml +++ b/examples/location/mapviewer/MapViewer/forms/RouteAddressForm.ui.qml diff --git a/examples/location/mapviewer/forms/RouteCoordinate.qml b/examples/location/mapviewer/MapViewer/forms/RouteCoordinate.qml index 003556c51..003556c51 100644 --- a/examples/location/mapviewer/forms/RouteCoordinate.qml +++ b/examples/location/mapviewer/MapViewer/forms/RouteCoordinate.qml diff --git a/examples/location/mapviewer/forms/RouteCoordinateForm.ui.qml b/examples/location/mapviewer/MapViewer/forms/RouteCoordinateForm.ui.qml index 88ff94dc1..88ff94dc1 100644 --- a/examples/location/mapviewer/forms/RouteCoordinateForm.ui.qml +++ b/examples/location/mapviewer/MapViewer/forms/RouteCoordinateForm.ui.qml diff --git a/examples/location/mapviewer/forms/RouteList.qml b/examples/location/mapviewer/MapViewer/forms/RouteList.qml index 8dbda7c01..8dbda7c01 100644 --- a/examples/location/mapviewer/forms/RouteList.qml +++ b/examples/location/mapviewer/MapViewer/forms/RouteList.qml diff --git a/examples/location/mapviewer/forms/RouteListDelegate.qml b/examples/location/mapviewer/MapViewer/forms/RouteListDelegate.qml index 680318ac3..680318ac3 100644 --- a/examples/location/mapviewer/forms/RouteListDelegate.qml +++ b/examples/location/mapviewer/MapViewer/forms/RouteListDelegate.qml diff --git a/examples/location/mapviewer/forms/RouteListHeader.qml b/examples/location/mapviewer/MapViewer/forms/RouteListHeader.qml index 4f8308091..4f8308091 100644 --- a/examples/location/mapviewer/forms/RouteListHeader.qml +++ b/examples/location/mapviewer/MapViewer/forms/RouteListHeader.qml diff --git a/examples/location/mapviewer/helper.js b/examples/location/mapviewer/MapViewer/helper.js index a42040518..a42040518 100644 --- a/examples/location/mapviewer/helper.js +++ b/examples/location/mapviewer/MapViewer/helper.js diff --git a/examples/location/mapviewer/map/MapComponent.qml b/examples/location/mapviewer/MapViewer/map/MapComponent.qml index 987455287..987455287 100644 --- a/examples/location/mapviewer/map/MapComponent.qml +++ b/examples/location/mapviewer/MapViewer/map/MapComponent.qml diff --git a/examples/location/mapviewer/map/MapSliders.qml b/examples/location/mapviewer/MapViewer/map/MapSliders.qml index d9c8381b0..d9c8381b0 100644 --- a/examples/location/mapviewer/map/MapSliders.qml +++ b/examples/location/mapviewer/MapViewer/map/MapSliders.qml diff --git a/examples/location/mapviewer/map/Marker.qml b/examples/location/mapviewer/MapViewer/map/Marker.qml index c7494cf57..c7494cf57 100644 --- a/examples/location/mapviewer/map/Marker.qml +++ b/examples/location/mapviewer/MapViewer/map/Marker.qml diff --git a/examples/location/mapviewer/map/MiniMap.qml b/examples/location/mapviewer/MapViewer/map/MiniMap.qml index f8fc51547..f8fc51547 100644 --- a/examples/location/mapviewer/map/MiniMap.qml +++ b/examples/location/mapviewer/MapViewer/map/MiniMap.qml diff --git a/examples/location/mapviewer/menus/ItemPopupMenu.qml b/examples/location/mapviewer/MapViewer/menus/ItemPopupMenu.qml index d559aca6c..d559aca6c 100644 --- a/examples/location/mapviewer/menus/ItemPopupMenu.qml +++ b/examples/location/mapviewer/MapViewer/menus/ItemPopupMenu.qml diff --git a/examples/location/mapviewer/menus/MainMenu.qml b/examples/location/mapviewer/MapViewer/menus/MainMenu.qml index 3523b5c1a..3523b5c1a 100644 --- a/examples/location/mapviewer/menus/MainMenu.qml +++ b/examples/location/mapviewer/MapViewer/menus/MainMenu.qml diff --git a/examples/location/mapviewer/menus/MapPopupMenu.qml b/examples/location/mapviewer/MapViewer/menus/MapPopupMenu.qml index 335788df8..335788df8 100644 --- a/examples/location/mapviewer/menus/MapPopupMenu.qml +++ b/examples/location/mapviewer/MapViewer/menus/MapPopupMenu.qml diff --git a/examples/location/mapviewer/menus/MarkerPopupMenu.qml b/examples/location/mapviewer/MapViewer/menus/MarkerPopupMenu.qml index 338f23859..338f23859 100644 --- a/examples/location/mapviewer/menus/MarkerPopupMenu.qml +++ b/examples/location/mapviewer/MapViewer/menus/MarkerPopupMenu.qml diff --git a/examples/location/mapviewer/MapViewer/qmldir b/examples/location/mapviewer/MapViewer/qmldir new file mode 100644 index 000000000..359ca02af --- /dev/null +++ b/examples/location/mapviewer/MapViewer/qmldir @@ -0,0 +1,27 @@ +module MapViewer +typeinfo mapviewer.qmltypes +Main 1.0 Main.qml +Helper 1.0 helper.js +MapComponent 1.0 map/MapComponent.qml +MapSliders 1.0 map/MapSliders.qml +Marker 1.0 map/Marker.qml +MiniMap 1.0 map/MiniMap.qml +ItemPopupMenu 1.0 menus/ItemPopupMenu.qml +MainMenu 1.0 menus/MainMenu.qml +MapPopupMenu 1.0 menus/MapPopupMenu.qml +MarkerPopupMenu 1.0 menus/MarkerPopupMenu.qml +Geocode 1.0 forms/Geocode.qml +GeocodeForm 1.0 forms/GeocodeForm.ui.qml +Message 1.0 forms/Message.qml +MessageForm 1.0 forms/MessageForm.ui.qml +ReverseGeocode 1.0 forms/ReverseGeocode.qml +ReverseGeocodeForm 1.0 forms/ReverseGeocodeForm.ui.qml +RouteCoordinate 1.0 forms/RouteCoordinate.qml +Locale 1.0 forms/Locale.qml +LocaleForm 1.0 forms/LocaleForm.ui.qml +RouteAddress 1.0 forms/RouteAddress.qml +RouteAddressForm 1.0 forms/RouteAddressForm.ui.qml +RouteCoordinateForm 1.0 forms/RouteCoordinateForm.ui.qml +RouteList 1.0 forms/RouteList.qml +RouteListDelegate 1.0 forms/RouteListDelegate.qml +RouteListHeader 1.0 forms/RouteListHeader.qml diff --git a/examples/location/mapviewer/resources/marker.png b/examples/location/mapviewer/MapViewer/resources/marker.png Binary files differindex 2116dfdf5..2116dfdf5 100644 --- a/examples/location/mapviewer/resources/marker.png +++ b/examples/location/mapviewer/MapViewer/resources/marker.png diff --git a/examples/location/mapviewer/resources/marker_blue.png b/examples/location/mapviewer/MapViewer/resources/marker_blue.png Binary files differindex 70f0c2538..70f0c2538 100644 --- a/examples/location/mapviewer/resources/marker_blue.png +++ b/examples/location/mapviewer/MapViewer/resources/marker_blue.png diff --git a/examples/location/mapviewer/resources/scale.png b/examples/location/mapviewer/MapViewer/resources/scale.png Binary files differindex c4f08122a..c4f08122a 100644 --- a/examples/location/mapviewer/resources/scale.png +++ b/examples/location/mapviewer/MapViewer/resources/scale.png diff --git a/examples/location/mapviewer/resources/scale_end.png b/examples/location/mapviewer/MapViewer/resources/scale_end.png Binary files differindex 94510b125..94510b125 100644 --- a/examples/location/mapviewer/resources/scale_end.png +++ b/examples/location/mapviewer/MapViewer/resources/scale_end.png diff --git a/examples/location/mapviewer/main.py b/examples/location/mapviewer/main.py index cd0d13776..24ae1623f 100644 --- a/examples/location/mapviewer/main.py +++ b/examples/location/mapviewer/main.py @@ -10,7 +10,7 @@ from pathlib import Path from PySide6.QtQml import QQmlApplicationEngine from PySide6.QtGui import QGuiApplication from PySide6.QtNetwork import QSslSocket -from PySide6.QtCore import QCoreApplication, QMetaObject, QUrl, Q_ARG +from PySide6.QtCore import QCoreApplication, QMetaObject, Q_ARG HELP = """Usage: plugin.<parameter_name> <parameter_value> - Sets parameter = value for plugin""" @@ -59,9 +59,8 @@ if __name__ == "__main__": engine = QQmlApplicationEngine() engine.rootContext().setContextProperty("supportsSsl", QSslSocket.supportsSsl()) - engine.addImportPath(":/imports") - qml_file = Path(__file__).parent / "mapviewer.qml" - engine.load(QUrl.fromLocalFile(qml_file)) + engine.addImportPath(Path(__file__).parent) + engine.loadFromModule("MapViewer", "Main") engine.quit.connect(QCoreApplication.quit) items = engine.rootObjects() diff --git a/examples/location/mapviewer/mapviewer.pyproject b/examples/location/mapviewer/mapviewer.pyproject index 868657d8b..8e2cadd2b 100644 --- a/examples/location/mapviewer/mapviewer.pyproject +++ b/examples/location/mapviewer/mapviewer.pyproject @@ -1,27 +1,33 @@ { "files": ["main.py", - "forms/Geocode.qml", - "forms/GeocodeForm.ui.qml", - "forms/Locale.qml", - "forms/LocaleForm.ui.qml", - "forms/Message.qml", - "forms/MessageForm.ui.qml", - "forms/ReverseGeocode.qml", - "forms/ReverseGeocodeForm.ui.qml", - "forms/RouteAddress.qml", - "forms/RouteAddressForm.ui.qml", - "forms/RouteCoordinate.qml", - "forms/RouteCoordinateForm.ui.qml", - "forms/RouteList.qml", - "forms/RouteListDelegate.qml", - "forms/RouteListHeader.qml", - "map/MapComponent.qml", - "map/MapSliders.qml", - "map/Marker.qml", - "map/MiniMap.qml", - "mapviewer.qml", - "menus/ItemPopupMenu.qml", - "menus/MainMenu.qml", - "menus/MapPopupMenu.qml", - "menus/MarkerPopupMenu.qml"] + "MapViewer/forms/Geocode.qml", + "MapViewer/forms/GeocodeForm.ui.qml", + "MapViewer/forms/Locale.qml", + "MapViewer/forms/LocaleForm.ui.qml", + "MapViewer/forms/Message.qml", + "MapViewer/forms/MessageForm.ui.qml", + "MapViewer/forms/ReverseGeocode.qml", + "MapViewer/forms/ReverseGeocodeForm.ui.qml", + "MapViewer/forms/RouteAddress.qml", + "MapViewer/forms/RouteAddressForm.ui.qml", + "MapViewer/forms/RouteCoordinate.qml", + "MapViewer/forms/RouteCoordinateForm.ui.qml", + "MapViewer/forms/RouteList.qml", + "MapViewer/forms/RouteListDelegate.qml", + "MapViewer/forms/RouteListHeader.qml", + "MapViewer/map/MapComponent.qml", + "MapViewer/map/MapSliders.qml", + "MapViewer/map/Marker.qml", + "MapViewer/map/MiniMap.qml", + "MapViewer/menus/ItemPopupMenu.qml", + "MapViewer/menus/MainMenu.qml", + "MapViewer/menus/MapPopupMenu.qml", + "MapViewer/menus/MarkerPopupMenu.qml", + "MapViewer/resources/marker_blue.png", + "MapViewer/resources/marker.png", + "MapViewer/resources/scale_end.png", + "MapViewer/resources/scale.png", + "MapViewer/helper.js", + "MapViewer/Main.qml", + "MapViewer/qmldir"] } |