I've figured it out, here's the complete code for anyone in the same situation. I needed to create the renderer as a JSON, that was correct. But a FeatureLayer couldn't be set with this renderer. I needed to use a ServiceFeatureTable with a custom Feature Collection Layer, so I adapted the sample code that had it.
Here's the result:
import QtQuick 2.6
import QtQuick.Controls 2.2
import Esri.ArcGISRuntime 100.7
ApplicationWindow {
id: rootRectangle
width: 800
height: 600
readonly property bool busy: featureTable.queryFeaturesStatus === Enums.TaskStatusInProgress
property var jsonChicago: {"type":"heatmap", "blurRadius":10, "colorStops":[
{
"ratio":0,
"color":[133,193,200,0]
},
{
"ratio":0.01,
"color":[133,193,200,0]
},
{
"ratio":0.01,
"color":[133,193,200,255]
},
{
"ratio":0.01,
"color":[133,193,200,255]
},
{
"ratio":0.0925,
"color":[156,129,132,255]
},
{
"ratio":0.17500000000000002,
"color":[156,129,132,255]
},
{
"ratio":0.2575,
"color":[167,97,170,255]
},
{
"ratio":0.34,
"color":[175,73,128,255]
},
{
"ratio":0.42250000000000004,
"color":[184,48,85,255]
},
{
"ratio":0.505,
"color":[192,24,42,255]
},
{
"ratio":0.5875,
"color":[200,0,0,255]
},
{
"ratio":0.67,
"color":[211,51,0,255]
},
{
"ratio":0.7525000000000001,
"color":[222,102,0,255]
},
{
"ratio":0.8350000000000001,
"color":[233,153,0,255]
},
{
"ratio":0.9175000000000001,
"color":[244,204,0,255]
},
{
"ratio":1,
"color":[255,255,0,255]
}
], "maxPixelIntensity":1967.488043588503, "minPixelIntensity": 0 }
SimpleRenderer {
id: rendererT
json :jsonChicago
}
Geodatabase {
id: gdb
path: pathName
onErrorChanged: errorMessage = error.message;
}
MapView {
id: mapView
anchors.fill: parent
Map {
id: map
BasemapStreetsVector {}
}
ServiceFeatureTable {
id: featureTable
url: "https://services5.arcgis.com/lVkj5PBOw7tRmIPU/arcgis/rest/services/Chicago_Crime_Map/FeatureServer/0"
onQueryFeaturesStatusChanged: {
if (queryFeaturesStatus !== Enums.TaskStatusCompleted)
return;
var featureCollectionTable = ArcGISRuntimeEnvironment.createObject("FeatureCollectionTable", {featureSet: queryFeaturesResult,renderer:rendererT});
var featureCollection = ArcGISRuntimeEnvironment.createObject("FeatureCollection");
featureCollection.tables.append(featureCollectionTable);
featureCollectionLayer.featureCollection = featureCollection;
}
Component.onCompleted: {
queryFeatures(queryParams);
}
}
}
QueryParameters {
id: queryParams
whereClause: "1=1"
}
FeatureCollectionLayer {
id: featureCollectionLayer
onFeatureCollectionChanged: {
map.operationalLayers.append(featureCollectionLayer);
}
}
BusyIndicator {
anchors.centerIn: parent
visible: busy
}
}