Skip to content

Commit 4504845

Browse files
committed
moved QmlExpression back to header
1 parent 76df5b0 commit 4504845

File tree

3 files changed

+40
-20
lines changed

3 files changed

+40
-20
lines changed

python/gui/auto_generated/editorwidgets/qgsqmlwidgetwrapper.sip.in

+21
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,27 @@ passes the ``feature`` into the context property of the widget
5858

5959
};
6060

61+
class QmlExpression : QObject
62+
{
63+
%Docstring
64+
To pass the QgsExpression functionality and it's context to the context of the QQuickWidget
65+
66+
.. versionadded:: 3.4
67+
%End
68+
69+
%TypeHeaderCode
70+
#include "qgsqmlwidgetwrapper.h"
71+
%End
72+
public:
73+
void setExpressionContext( const QgsExpressionContext &context );
74+
75+
QVariant evaluate( const QString &expression ) const;
76+
%Docstring
77+
evaluates the value regarding the /a expression and the context
78+
%End
79+
80+
};
81+
6182
/************************************************************************
6283
* This file has been generated automatically from *
6384
* *

src/gui/editorwidgets/qgsqmlwidgetwrapper.cpp

-20
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,6 @@
2020
#include <QQmlContext>
2121
#include <QQmlEngine>
2222

23-
/**
24-
* \ingroup gui
25-
* To pass the QgsExpression functionality and it's context to the context of the QQuickWidget
26-
* \since QGIS 3.4
27-
*/
28-
class GUI_EXPORT QmlExpression : public QObject
29-
{
30-
Q_OBJECT
31-
32-
public:
33-
void setExpressionContext( const QgsExpressionContext &context );
34-
35-
//! evaluates the value regarding the /a expression and the context
36-
Q_INVOKABLE QVariant evaluate( const QString &expression ) const;
37-
38-
private:
39-
QgsExpressionContext mExpressionContext;
40-
};
41-
42-
4323
QgsQmlWidgetWrapper::QgsQmlWidgetWrapper( QgsVectorLayer *layer, QWidget *editor, QWidget *parent )
4424
: QgsWidgetWrapper( layer, editor, parent )
4525
{

src/gui/editorwidgets/qgsqmlwidgetwrapper.h

+19
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,23 @@ class GUI_EXPORT QgsQmlWidgetWrapper : public QgsWidgetWrapper
6363
QQuickWidget *mWidget = nullptr;
6464
};
6565

66+
/**
67+
* \ingroup gui
68+
* To pass the QgsExpression functionality and it's context to the context of the QQuickWidget
69+
* \since QGIS 3.4
70+
*/
71+
class GUI_EXPORT QmlExpression : public QObject
72+
{
73+
Q_OBJECT
74+
75+
public:
76+
void setExpressionContext( const QgsExpressionContext &context );
77+
78+
//! evaluates the value regarding the /a expression and the context
79+
Q_INVOKABLE QVariant evaluate( const QString &expression ) const;
80+
81+
private:
82+
QgsExpressionContext mExpressionContext;
83+
};
84+
6685
#endif // QGSQMLWIDGETWRAPPER_H

0 commit comments

Comments
 (0)