Skip to content
Permalink
Browse files
Make a couple of QgsJsonUtils accessible via QML environment
  • Loading branch information
nirvn committed Jun 11, 2021
1 parent 25b89e0 commit 256dc35a091abeb3bdce136d7581cb6a6c426328
Showing with 7 additions and 2 deletions.
  1. +3 −0 python/core/auto_generated/qgsjsonutils.sip.in
  2. +4 −2 src/core/qgsjsonutils.h
@@ -273,6 +273,9 @@ Helper utilities for working with JSON and GeoJSON conversions.
%TypeHeaderCode
#include "qgsjsonutils.h"
%End
public:
static const QMetaObject staticMetaObject;

public:

static QgsFeatureList stringToFeatureList( const QString &string, const QgsFields &fields = QgsFields(), QTextCodec *encoding = 0 );
@@ -290,6 +290,8 @@ class CORE_EXPORT QgsJsonExporter

class CORE_EXPORT QgsJsonUtils
{
Q_GADGET

public:

/**
@@ -317,7 +319,7 @@ class CORE_EXPORT QgsJsonUtils
* \param value value to encode
* \returns encoded value
*/
static QString encodeValue( const QVariant &value );
Q_INVOKABLE static QString encodeValue( const QVariant &value );

/**
* Exports all attributes from a QgsFeature as a JSON map type.
@@ -351,7 +353,7 @@ class CORE_EXPORT QgsJsonUtils
* the conversion is not possible.
* \since QGIS 3.0
*/
static QVariantList parseArray( const QString &json, QVariant::Type type = QVariant::Invalid );
Q_INVOKABLE static QVariantList parseArray( const QString &json, QVariant::Type type = QVariant::Invalid );


/**

0 comments on commit 256dc35

Please sign in to comment.