Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.3
-
None
-
All
-
c2d6eb9dca7546bbe8d9c6c62db683615e4b23a7
Description
lupdate does not find strings in operator overloading methods. My case is a class (QObject descendant), inside a namespace.
namespace Test
{
class MyClass : public QObject
{
Q_OBJECT
public:
explicit MyClass(QObject *parent = 0) : QObject(parent) { }
void myMethod();
MyClass *operator<<(int i);
};
This is the .cpp file of this class:
/*
TRANSLATOR Test::MyClass
*/
#include <QProgressDialog>
#include "test.h"
using namespace Test;
void MyClass::myMethod()
{
QProgressDialog dialog(tr("Can see this string"),QString(),0,10);
dialog.exec();
}
MyClass *MyClass::operator<<(int i)
{
QProgressDialog dialog(tr("Cannot see this string"),QString(),0,10);
dialog.exec();
return this;
}
The string in "myMethod" is found by lupdate, the one in << operator not.
lupdate reports:
lupdate . -ts lupdate_test.ts
Scanning directory '.'...C:/Qt4Projects/lupdate_bug/test.cpp:20: tr() cannot be
called without context
Updating 'lupdate_test.ts'...
Found 1 source text(s) (1 new and 0 already existing)
Qt 4.5.3 was the latest version (AFAIK) that didn't have this problem.