diff options
author | kh1 <karsten.heimrich@digia.com> | 2014-06-06 13:05:18 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2014-06-06 14:09:32 +0200 |
commit | c777742754885c876ebc82f1e49be1a825446657 (patch) | |
tree | 3610da77901a8873e2c014240b49467330d78c2a /src/libs/installer/scriptengine_p.h | |
parent | 598901e70bc5bbba60055a2b867994a94494c759 (diff) |
Expose qsTr to the scripts, makes component error example work.
Change-Id: I73be2490182af8582b3e56b177e8ca26c950fa97
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
Diffstat (limited to 'src/libs/installer/scriptengine_p.h')
-rw-r--r-- | src/libs/installer/scriptengine_p.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/libs/installer/scriptengine_p.h b/src/libs/installer/scriptengine_p.h index 0ab54df7c..3476ab1e8 100644 --- a/src/libs/installer/scriptengine_p.h +++ b/src/libs/installer/scriptengine_p.h @@ -126,10 +126,32 @@ public slots : } }; -} +#if QT_VERSION < 0x050400 +class QCoreApplicationProxy : public QObject +{ + Q_OBJECT + Q_DISABLE_COPY(QCoreApplicationProxy) + +public: + QCoreApplicationProxy() {} + +public slots: + QString qsTr(const QString &text = QString(), const QString &disambiguation = QString(), int n = -1) const + { + return QCoreApplication::translate(QCoreApplication::applicationName().toUtf8().constData(), + text.toUtf8().constData(), disambiguation.toUtf8().constData(), n); + } +}; +#endif + +} // namespace QInstaller + Q_DECLARE_METATYPE(QInstaller::ConsoleProxy*) Q_DECLARE_METATYPE(QInstaller::InstallerProxy*) Q_DECLARE_METATYPE(QInstaller::QFileDialogProxy*) Q_DECLARE_METATYPE(QInstaller::QDesktopServicesProxy*) +#if QT_VERSION < 0x050400 +Q_DECLARE_METATYPE(QInstaller::QCoreApplicationProxy*) +#endif #endif // SCRIPTENGINE_H |