make Q_DECLARE_TR_FUNCTIONS() compile with QT_NO_DEPRECATED

Change-Id: I9cde256347e5b59f7754bc578e56c60227c926ab
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Oswald Buddenhagen 2012-12-06 21:05:34 +01:00 committed by The Qt Project
parent 1188885fdf
commit 203f2800c0

View File

@ -215,12 +215,19 @@ inline QString QCoreApplication::translate(const char *, const char *sourceText,
}
#endif
#ifdef QT_NO_DEPRECATED
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context)
#else
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) \
QT_DEPRECATED static inline QString trUtf8(const char *sourceText, const char *disambiguation = 0, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); }
#endif
#define Q_DECLARE_TR_FUNCTIONS(context) \
public: \
static inline QString tr(const char *sourceText, const char *disambiguation = 0, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); } \
QT_DEPRECATED static inline QString trUtf8(const char *sourceText, const char *disambiguation = 0, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); } \
QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) \
private:
typedef void (*QtStartUpFunction)();