Skip to content
Permalink
Browse files

moved QmlExpression back to header

  • Loading branch information
signedav committed Sep 5, 2018
1 parent 76df5b0 commit 4504845311698f5088c86c12837aa91c609675ad
@@ -58,6 +58,27 @@ passes the ``feature`` into the context property of the widget

};

class QmlExpression : QObject
{
%Docstring
To pass the QgsExpression functionality and it's context to the context of the QQuickWidget

.. versionadded:: 3.4
%End

%TypeHeaderCode
#include "qgsqmlwidgetwrapper.h"
%End
public:
void setExpressionContext( const QgsExpressionContext &context );

QVariant evaluate( const QString &expression ) const;
%Docstring
evaluates the value regarding the /a expression and the context
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
@@ -20,26 +20,6 @@
#include <QQmlContext>
#include <QQmlEngine>

/**
* \ingroup gui
* To pass the QgsExpression functionality and it's context to the context of the QQuickWidget
* \since QGIS 3.4
*/
class GUI_EXPORT QmlExpression : public QObject
{
Q_OBJECT

public:
void setExpressionContext( const QgsExpressionContext &context );

//! evaluates the value regarding the /a expression and the context
Q_INVOKABLE QVariant evaluate( const QString &expression ) const;

private:
QgsExpressionContext mExpressionContext;
};


QgsQmlWidgetWrapper::QgsQmlWidgetWrapper( QgsVectorLayer *layer, QWidget *editor, QWidget *parent )
: QgsWidgetWrapper( layer, editor, parent )
{
@@ -63,4 +63,23 @@ class GUI_EXPORT QgsQmlWidgetWrapper : public QgsWidgetWrapper
QQuickWidget *mWidget = nullptr;
};

/**
* \ingroup gui
* To pass the QgsExpression functionality and it's context to the context of the QQuickWidget
* \since QGIS 3.4
*/
class GUI_EXPORT QmlExpression : public QObject
{
Q_OBJECT

public:
void setExpressionContext( const QgsExpressionContext &context );

//! evaluates the value regarding the /a expression and the context
Q_INVOKABLE QVariant evaluate( const QString &expression ) const;

private:
QgsExpressionContext mExpressionContext;
};

#endif // QGSQMLWIDGETWRAPPER_H

0 comments on commit 4504845

Please sign in to comment.
You can’t perform that action at this time.