From c777742754885c876ebc82f1e49be1a825446657 Mon Sep 17 00:00:00 2001 From: kh1 Date: Fri, 6 Jun 2014 13:05:18 +0200 Subject: Expose qsTr to the scripts, makes component error example work. Change-Id: I73be2490182af8582b3e56b177e8ca26c950fa97 Reviewed-by: Jarek Kobus --- src/libs/installer/scriptengine_p.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/libs/installer/scriptengine_p.h') 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 -- cgit v1.2.3