qt.cfg: Add support for QT_TR_NOOP* and QT_TRANSLATE_NOOP* macros

Reference:
https://doc.qt.io/qt-5/i18n-source-translation.html#using-qt-tr-noop-and-qt-translate-noop-in-c
This commit is contained in:
versat 2019-02-12 10:21:56 +01:00
parent a41e663cd1
commit fe6ea282d3
2 changed files with 9 additions and 0 deletions

View File

@ -1326,6 +1326,12 @@
<define name="Q_RETURN_ARG(type, data)" value="QReturnArgument&lt;type &gt;(#type, data)"/>
<define name="Q_UNLIKELY(expr)" value="expr"/>
<define name="Q_UNUSED(X)" value="(void)X;"/>
<define name="QT_TR_NOOP(x)" value="x"/>
<define name="QT_TR_NOOP_UTF8(x)" value="x"/>
<define name="QT_TRANSLATE_NOOP(scope, x)" value="x"/>
<define name="QT_TRANSLATE_NOOP_UTF8(scope, x)" value="x"/>
<define name="QT_TRANSLATE_NOOP3(scope, x, comment)" value="{x, comment}"/>
<define name="QT_TRANSLATE_NOOP3_UTF8(scope, x, comment)" value="{x, comment}"/>
<define name="QCOMPARE(a,b)" value="assert( (a) == (b) )"/>
<define name="QVERIFY(expr)" value="assert( expr )"/>
<define name="QVERIFY2(cond, msg)" value="assert( cond )"/>

View File

@ -11,6 +11,7 @@
#include <QString>
#include <QtPlugin>
#include <QFile>
#include <cstdio>
void QString1(QString s)
@ -57,6 +58,8 @@ void validCode(int * pIntPtr)
if (Q_LIKELY(pIntPtr)) {}
if (Q_UNLIKELY(!pIntPtr)) {}
printf(QT_TR_NOOP("Hi"));
}
void ignoredReturnValue()