diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-09 15:09:20 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-09 15:09:26 +0100 |
commit | ff466a1881435f927f5df9ce1e5eac07d5591904 (patch) | |
tree | 760e068743e6a8e1cc4ec63bb2f8e7dcef88b3e2 /src/qml/jsapi/qjsengine.cpp | |
parent | e04822f3c2a6b69b7d75e2039256aa2433c59dd2 (diff) | |
parent | 4a3f6e58b591f2fe2204f7cbc1efc8abb0aade74 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/qml/jsruntime/qv4arraydata.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4globalobject.cpp
src/qml/jsruntime/qv4internalclass.cpp
src/quick/items/qquicktext_p.h
src/quick/items/qquicktextedit_p.h
src/quick/items/qquicktextinput_p.h
Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
Diffstat (limited to 'src/qml/jsapi/qjsengine.cpp')
-rw-r--r-- | src/qml/jsapi/qjsengine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp index 427575b386..fba5d1a910 100644 --- a/src/qml/jsapi/qjsengine.cpp +++ b/src/qml/jsapi/qjsengine.cpp @@ -243,6 +243,8 @@ void QJSEngine::collectGarbage() \row \li QT_TRID_NOOP() \li QT_TRID_NOOP() \endtable + It also adds an arg() method to the string prototype. + \sa {Internationalization with Qt} */ void QJSEngine::installTranslatorFunctions(const QJSValue &object) @@ -260,6 +262,10 @@ void QJSEngine::installTranslatorFunctions(const QJSValue &object) obj->defineDefaultProperty(QStringLiteral("QT_TR_NOOP"), QV4::GlobalExtensions::method_qsTrNoOp); obj->defineDefaultProperty(QStringLiteral("qsTrId"), QV4::GlobalExtensions::method_qsTrId); obj->defineDefaultProperty(QStringLiteral("QT_TRID_NOOP"), QV4::GlobalExtensions::method_qsTrIdNoOp); + + // string prototype extension + v4->stringObjectClass->prototype->defineDefaultProperty(QStringLiteral("arg"), + QV4::GlobalExtensions::method_string_arg); #endif } |