Callout example in ArcGIS Qt

1457
9
Jump to solution
12-30-2019 02:57 AM
AbhijeetSatam
New Contributor III

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??

0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

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  

View solution in original post

9 Replies
LucasDanzinger
Esri Frequent Contributor

By "pure CPP", do you mean using Qt Widgets?

0 Kudos
AbhijeetSatam
New Contributor III

yes 

0 Kudos
LucasDanzinger
Esri Frequent Contributor

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.

0 Kudos
AbhijeetSatam
New Contributor III

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??

0 Kudos
LucasDanzinger
Esri Frequent Contributor

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. 

0 Kudos
ljballer
New Contributor II

@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!

0 Kudos
LucasDanzinger
Esri Frequent Contributor

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  

koraykoca
New Contributor

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.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

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?

 

 

0 Kudos