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?
using Qt Creator 5.0.2
using Esri.ArcGISRuntime 100.14
queryFeatures works fine
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?
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.
Thanks for the reply.
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.
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.