AppStudio 5.4 on Windows - queryStatistics using a web map featureTable fails to return data

506
3
08-25-2022 11:21 AM
BurnsideAdmin
New Contributor II

Hello community,

I'm using AppStudio 5.4 and the 5.4 Map Viewer template connected to a secured ArcGIS Enterprise Web Map.
I've written some custom QML code to do a statistical query on one of the layers. This test query should return the count for each type of "maintenanceClass".
Because the statistical query failed, I decided to test a similar query to simply return features. This worked fine.
My question is - How does one properly use the queryStatistics method when using a web map layer?

Notes:

using Qt Creator 5.0.2
using Esri.ArcGISRuntime 100.14
queryFeatures works fine
queryStatistics fails
fail message is: QObject::connect: Cannot queue arguments of type 'std::shared_ptr<QRTImpl::StatisticsQueryResultImpl>'(Make sure 'std::shared_ptr<QRTImpl::StatisticsQueryResultImpl>' is registered using qRegisterMetaType().)
statistical query based on Esri example https://developers.arcgis.com/qt/qml/sample-code/statistical-query-group-sort/
layer Supports Advanced Queries: true
layer Supports Statistics: true
layer Use Standardized Queries: true

Code snippet attached.

I'm developing in Windows and targeting iOS.
Anyone have any ideas?

Thanks

0 Kudos
3 Replies
TrevorFrame
Esri Contributor

Hi @BurnsideAdmin,

Looking at your code snippet you provided, it seems like it should work properly as you are using a Service Feature Table and waiting on the Query Statistic Status. Have you tried copying the runtime sample into an AppStudio app to test whether that runs for you? Based on the error message you provided, it seems like it's having an issue implementing the query results property that is used to store the results. If you are getting the same error with the Runtime sample, there may be an issue not related to how your code is setup. 

Best, 

Trevor

0 Kudos
BurnsideAdmin
New Contributor II

Hello Trevor,

Thanks for the reply.

You wrote:

Have you tried copying the runtime sample into an AppStudio app to test whether that runs for you?

Yes, the sample code ran properly when I tried it in a test app. The sample code creates a service feature  table by declaring a ServiceFeatureTable with a URL. My service feature  table is derived from a layer in a secured web map. I wonder if this is where the problem lies.

Gord

0 Kudos
TrevorFrame
Esri Contributor

If it is secured and you're not authenticating, then there would be a problem accessing the layer that contains the feature table. The error code doesn't necessarily indicate this, but it could be the culprit. An easy way to test it is swapping the ServiceFeatureTable url with your layer url in the sample app that is currently working. You should see the same error message as the template. 

Another thing you can try is navigating into the App settings and enabling the "Support secured maps"  setting under Properties -> Gallery. This should make it so when ran, a Sign In button will appear on the landing page. 

Screen Shot 2022-08-30 at 8.44.45 AM.png

Best,

Trevor

0 Kudos