diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-09 09:53:01 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-12-09 11:43:35 +0100 |
commit | 14f0efa0aea942b4483796d42e618366257f7a36 (patch) | |
tree | b0a1ebfbb70c07bdb0041e48e2852f241724d439 /src/qml/jsapi | |
parent | 87e4279651cf691e82f266d61330f8daf4300da2 (diff) | |
parent | e701690f79a7a0eecdb98d32c8f5130b67637256 (diff) |
Merge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into refs/staging/5.4
Diffstat (limited to 'src/qml/jsapi')
-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 0d2b394cd6..d7f45b56e0 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 } |