diff --git a/src/PythonQtStdDecorators.cpp b/src/PythonQtStdDecorators.cpp index d604613..3a92abc 100644 --- a/src/PythonQtStdDecorators.cpp +++ b/src/PythonQtStdDecorators.cpp @@ -42,7 +42,7 @@ #include "PythonQtStdDecorators.h" #include "PythonQt.h" #include "PythonQtClassInfo.h" - +#include bool PythonQtStdDecorators::connect(QObject* sender, const QByteArray& signal, PyObject* callable) { @@ -153,3 +153,9 @@ QVariantList PythonQtStdDecorators::children(QObject* o) } return v; } + +QString PythonQtStdDecorators::tr(QObject* obj, const QByteArray& text, const QByteArray& ambig, int n) +{ + return QCoreApplication::translate(obj->metaObject()->className(), text.constData(), ambig.constData(), QCoreApplication::CodecForTr, n); +} + diff --git a/src/PythonQtStdDecorators.h b/src/PythonQtStdDecorators.h index 505bd91..1fde33a 100644 --- a/src/PythonQtStdDecorators.h +++ b/src/PythonQtStdDecorators.h @@ -91,6 +91,8 @@ public slots: int static_Qt_qrand() { return qrand(); } void static_Qt_qsrand(uint a) { qsrand(a); } + QString tr(QObject* obj, const QByteArray& text, const QByteArray& text = QByteArray(), int n = -1); + QByteArray static_Qt_SIGNAL(const QByteArray& s) { return QByteArray("2") + s; } QByteArray static_Qt_SLOT(const QByteArray& s) { return QByteArray("1") + s; }