[QGIS-Developer] How to force 'json(tree)' widget in feature info panel
Even Rouault
even.rouault at spatialys.com
Thu Dec 5 13:24:49 PST 2024
Richard,
see
https://github.com/qgis/QGIS/blob/806ea8b9cff8a337c9f82fa2f831bb744b60097f/src/providers/wfs/qgswfsprovider.cpp#L2083
: field.setEditorWidgetSetup( QgsEditorWidgetSetup( QStringLiteral(
"JsonEdit" ), QVariantMap() ) );
Even
Le 05/12/2024 à 22:15, Richard Duivenvoorde via QGIS-Developer a écrit :
> Hi Devs,
>
> Working with an api which returns json, we thought to make it possible
> to see the returned (small) json documents as a json tree widget (like
> you for example can see in a SensorThingsApi identify result, see
> screendump).
>
> So creating a memory layer using and setting the providers attributes
> using a QgsField like:
>
> QgsField(name="json", type=QMetaType.QVariantMap, typeName='json',
> len=0, prec=0, comment="", subType=QMetaType.QString)])
>
> (for which I stole type and subtype en typename from a layer which was
> showing the json widget...)
>
> But in the featureinfo result the 'json'-field keeps being show as a
> plain string.
>
> Am I missing some detail? Or magic?
> Or is this something not possible with Memory Layers?
>
> Any hint is appreciated.
>
> Regards,
>
> Richard Duivenvoorde
>
>
> PS recently I was also asked by somebody if there was a plugin or
> widget which was able to show the result of an rest/json api call
> (upon clicking on a feature) in some kind of treeview (like Postman or
> even browsers) too...
> I think some standard way of talking to simple api's from within QGIS
> would be a good thing to have..
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
--
http://www.spatialys.com
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.
More information about the QGIS-Developer
mailing list