PDA

View Full Version : QT_TR_NOOP doesnt work



vhptt
1st August 2012, 03:40
I have this source:
File stringconstant.h

#include <QString>
#include <QStringList>
class StringConstant : public QObject
{
Q_OBJECT
public:
static const QStringList EXAMPLE_LIST;
};
File stringconstant.cpp

#include "stringconstant.h"
#include <QStringList>
const QStringList StringConstant::EXAMPLE_LIST = QStringList() << QT_TR_NOOP("Hello")
<< QT_TR_NOOP("Mother")
<< QT_TR_NOOP("Father");
Problem is: when I run lupdate, the .ts file created, but it have nothing.
How can I fix this ?

ChrisW67
1st August 2012, 09:17
QT_TR_NOOP is for use where the context of the string can be deduced (you were receiving a warning from lupdate regarding this). You should use QT_TRANSLATE_NOOP and specify a context.