Skip to content

Commit

Permalink
Make a couple of QgsJsonUtils accessible via QML environment
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jun 11, 2021
1 parent 25b89e0 commit 256dc35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions python/core/auto_generated/qgsjsonutils.sip.in
Expand Up @@ -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 );
Expand Down
6 changes: 4 additions & 2 deletions src/core/qgsjsonutils.h
Expand Up @@ -290,6 +290,8 @@ class CORE_EXPORT QgsJsonExporter

class CORE_EXPORT QgsJsonUtils
{
Q_GADGET

public:

/**
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 );


/**
Expand Down

0 comments on commit 256dc35

Please sign in to comment.