1. How to use this example : arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/ShowCallout at master · E... without any qml code?
2. I am trying to implement this code in pure CPP but the calloutDataChanged() signal is not generated. My guess is that this is occuring because my Component (callout) is not binded to the QProperty.
What is the CPP equivalent for the following qml code in the ShowCallout.qml file???
Callout {
id: callout
calloutData: showCalloutSample.calloutData // bind to the property that is exposed
accessoryButtonHidden: true
leaderPosition: leaderPositionEnum.Automatic
}
3. Is there any reason which is causing the code to fail??
Solved! Go to Solution.
Yes, this is still the case. I think you have a few options:
* Build your own Callout in Widgets. This could use the CalloutData class still to determine where to draw the callout and what it should display. https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-calloutdata.html
* Use a TextSymbol to display text at a given location https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-textsymbol.html
By "pure CPP", do you mean using Qt Widgets?
yes
We don't currently have a Callout view component for Widgets. It is something we would like to do in the future. At the moment, you'll need to consume the CalloutData in a Widget that you've created.
Hi Lucas,
Thanks for the response.
So you mean to say that the callout example has to use the qml components and cant be written in pure cpp??
It can be written in pure c++, you'll just need to design your own UI for it. With QML, we provide a UI for you right out of the box. It will be more work, but you should be able to accomplish the same thing.
@LucasDanzinger
Is this still the case as of July 2022?
If so, what would you recommend I do to replace a callout for graphics?
Thanks!
Yes, this is still the case. I think you have a few options:
* Build your own Callout in Widgets. This could use the CalloutData class still to determine where to draw the callout and what it should display. https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-calloutdata.html
* Use a TextSymbol to display text at a given location https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-textsymbol.html
Hi Lucas,
Could you elaborate on "Build your own Callout in Widgets"? Do you mean creating a new Widget and add it to layers? In this case, I didn't understand well how to use CalloutData class with QWidget.
CalloutData contains all of the information about where to display the view (screen point) and what to display in the view (title, detail, image, etc). This will be applicable whether using Qt Quick and Qt Widgets.
The piece that is missing for Widgets is the actual view. In Qt Quick, we use QML Shapes to draw the actual view. We used to use a QML Canvas before Shapes was introduced. For Widgets, I don't have any specific recommendations at this point, as we haven't prototyped anything yet. Perhaps you could use QPainter or something along those lines?