Changeset View
Changeset View
Standalone View
Standalone View
templates/scriptabletags/scriptablefilter.h
Show All 15 Lines | 1 | /* | |||
---|---|---|---|---|---|
16 | You should have received a copy of the GNU Lesser General Public | 16 | You should have received a copy of the GNU Lesser General Public | ||
17 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 17 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
18 | 18 | | |||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef SCRIPTABLE_FILTER_H | 21 | #ifndef SCRIPTABLE_FILTER_H | ||
22 | #define SCRIPTABLE_FILTER_H | 22 | #define SCRIPTABLE_FILTER_H | ||
23 | 23 | | |||
24 | #include <QtScript/QScriptValue> | 24 | #include <QtQml/QJSValue> | ||
25 | 25 | | |||
26 | #include "filter.h" | 26 | #include "filter.h" | ||
27 | 27 | | |||
28 | using namespace Grantlee; | 28 | using namespace Grantlee; | ||
29 | 29 | | |||
30 | class ScriptableFilter : public Filter | 30 | class ScriptableFilter : public Filter | ||
31 | { | 31 | { | ||
32 | public: | 32 | public: | ||
33 | ScriptableFilter(const QScriptValue &filterObject, QScriptEngine *engine); | 33 | ScriptableFilter(const QJSValue &filterObject, QJSEngine *engine); | ||
34 | ~ScriptableFilter() override; | 34 | ~ScriptableFilter() override; | ||
35 | 35 | | |||
36 | QVariant doFilter(const QVariant &input, const QVariant &argument, | 36 | QVariant doFilter(const QVariant &input, const QVariant &argument, | ||
37 | bool autoescape = false) const override; | 37 | bool autoescape = false) const override; | ||
38 | 38 | | |||
39 | bool isSafe() const override; | 39 | bool isSafe() const override; | ||
40 | 40 | | |||
41 | private: | 41 | private: | ||
42 | QScriptValue m_filterObject; | 42 | QJSValue m_filterObject; | ||
43 | QScriptEngine *m_scriptEngine; | 43 | QJSEngine *m_scriptEngine; | ||
44 | }; | 44 | }; | ||
45 | 45 | | |||
46 | #endif | 46 | #endif |