I have an application in which I am displaying the wgs84 coordinates on mouse click. There is a button which if clicked allows me to draw transects on the map(via mouse click). I would like to display the wgs84 coordinates in my transect application as well on mouse click. The transect qml file and the display coordinate qml file are different. Is there any way to use the display coordinate qml within my transect qml file?
Hi @SupratimChatterjee ,
I think the only piece you may be missing is the type registration.
https://github.com/Esri/arcgis-runtime-samples-qt/blob/main/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/ShowCallout/ShowCallout.cpp#L36-L41
If you need to expose data from C++ to QML, you can use Q_PROPERTY for that.
https://github.com/Esri/arcgis-runtime-samples-qt/blob/main/ArcGISRuntimeSDKQt_CppSamples/Routing/NavigateRoute/NavigateRoute.h#L46-L48
Let me know if that works for you.
Yes this is possible, but the specifics may differ based on your approach or specific app architecture.
We have a sample now, the HillShadeRenderer sample that has three qml files in the same app. They are able to share info and cross-call between them as needed.
https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_QMLSamples/Layers/Hillshade_Renderer
You can see that https://github.com/Esri/arcgis-runtime-samples-qt/blob/main/ArcGISRuntimeSDKQt_QMLSamples/Layers/Hillshade_Renderer/HillshadeSettings.qml#L127 is calling a applyHillshadeRenderer function defined over in a different qml file: https://github.com/Esri/arcgis-runtime-samples-qt/blob/main/ArcGISRuntimeSDKQt_QMLSamples/Layers/Hillshade_Renderer/Hillshade_Renderer.qml#L83
Using a similar pattern you should be able to share info between your qml files in your application.
Hi @JamesBallard1
Actually, I have a C++ backend with the frontend in qml. I would like to know if there is a way of combining these 2 projects .
arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/ShowCallout at main · Esri/arcgis-runtime-samples-qt (github.com)
(ShowCallout example)
arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/Geometry/GeodesicOperations at main · Esri/arcgis-runtime-samples-qt (github.com)
(Geodesic operations example)
I have tried to use the showCallout.qml within the geodesicoperations.qml but I get the error of unknown type.
I did the type registration. Turns out that I just had to implement a part of my code in the geodesicoperations file and import the arcgis toolkit in the qml file.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.