Obsolete Members for QJSEngine

以下成員源於類 QJSEngine 已過時。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

公共函數

(obsolete) void installTranslatorFunctions (const QJSValue & object = QJSValue())

成員函數文檔編製

void QJSEngine:: installTranslatorFunctions (const QJSValue & object = QJSValue())

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Installs translator functions on the given object , or on the Global Object if no object is specified.

The relation between script translator functions and C++ translator functions is described in the following table:

Script Function Corresponding C++ Function
qsTr() QObject::tr ()
QT_TR_NOOP () QT_TR_NOOP ()
qsTranslate() QCoreApplication::translate ()
QT_TRANSLATE_NOOP () QT_TRANSLATE_NOOP ()
qsTrId() qtTrId ()
QT_TRID_NOOP () QT_TRID_NOOP ()

It also adds an arg() method to the string prototype.

該函數在 Qt 5.4 引入。

另請參閱 Qt 國際化 .