qt의 번역과 관련하여 문제가 있습니다. 내 porject의 모든 번역은 정상적으로 작동하지만 하나는 클래스의 정적 변수에 있습니다.정적 변수의 qt tr()
헤더 파일은 다음과 유사합니다 다음과 같이 코드의 해당 부분은 같습니다
typedef struct {
int type;
QString problematicString;
} info;
MyClass::QObject_Descendant
{
Q_OBJECT;
//some functions like constructor, destructor... etc.
....
static info myClassInfo;//class that makes problems
}
다음과 같이 구현 파일에서 나는 변수를 초기화 :
info MyClass::myClassInfo={
1,
tr("something to be translated")
};
을 그리고 난 (시도 할 어떤 QT_TR_NOOP, tr() 및 기타) myClassInfo.problematicString을 변환 할 수 없습니다. 가장 이상한 점은 텍스트 "번역 할 내용" 이 * .ts 파일에 나타납니다.
누군가 힌트가 있으면 나와 공유하십시오. 미리 감사드립니다.
Chris.
비슷한 질문은 여기 http://stackoverflow.com/questions/1486492/qt-tr-does-not-seem-to-work-on-static-constant-members – sje397