From d2fd8010d3d3a6493df1a848c342db40555b4c1f Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 13 Feb 2019 15:54:14 +0100 Subject: Support QRegularExpression on the same level as QRegExp QRegularExpression is the recommended way to do regular expressions nowadays. Support assignment of JavaScript regular expressions to QRegularExpression properties of QObjects and the other way around. QJSValue::toVariant() will create a QRegularExpression from a JavaScript RegExp by default now. [ChangeLog][QtQml][Important Behavior Changes] QRegularExpression is now supported the same way QRegExp is in QML. QJSValue::toVariant() creates a QRegularExpression variant rather than a QRegExp one from a JavaScript regular expression now. Fixes: QTBUG-73429 Change-Id: I301a02771cd17903406c2bc5c7aaeca6cce629f0 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4engine_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/qml/jsruntime/qv4engine_p.h') diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 4557f623d0..3735c24601 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -520,6 +520,9 @@ public: Heap::RegExpObject *newRegExpObject(const QString &pattern, int flags); Heap::RegExpObject *newRegExpObject(RegExp *re); Heap::RegExpObject *newRegExpObject(const QRegExp &re); +#if QT_CONFIG(regularexpression) + Heap::RegExpObject *newRegExpObject(const QRegularExpression &re); +#endif Heap::Object *newErrorObject(const Value &value); Heap::Object *newErrorObject(const QString &message); -- cgit v1.2.3