summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobjectdefs.h
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2011-11-28 15:24:25 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-30 22:28:02 +0100
commit53a420a4d1a2d845603dd85ce9ce345c6819088e (patch)
tree6b1e78ddcfc8843122805273c51cef932c9125e1 /src/corelib/kernel/qobjectdefs.h
parent49140efe2d0a31fd529b8e6af09e0df31e3a719c (diff)
Merge QObject::tr*() and QCoreApplication::translate() overloads
These were marked as TODO items for Qt 5. Do them now. (The TODO item was added when plural support was added back in the early Qt 4 days.) Change-Id: I3be50bc657582db730401103d691234695784340 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel/qobjectdefs.h')
-rw-r--r--src/corelib/kernel/qobjectdefs.h21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 2b57b403b3..bfb6808ad5 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -91,23 +91,15 @@ class QString;
#ifndef QT_NO_TRANSLATION
# ifndef QT_NO_TEXTCODEC
// full set of tr functions
-// ### Qt 5: merge overloads
# define QT_TR_FUNCTIONS \
- static inline QString tr(const char *s, const char *c = 0) \
- { return staticMetaObject.tr(s, c); } \
- static inline QString trUtf8(const char *s, const char *c = 0) \
- { return staticMetaObject.trUtf8(s, c); } \
- static inline QString tr(const char *s, const char *c, int n) \
+ static inline QString tr(const char *s, const char *c = 0, int n = -1) \
{ return staticMetaObject.tr(s, c, n); } \
- static inline QString trUtf8(const char *s, const char *c, int n) \
+ static inline QString trUtf8(const char *s, const char *c = 0, int n = -1) \
{ return staticMetaObject.trUtf8(s, c, n); }
# else
// no QTextCodec, no utf8
-// ### Qt 5: merge overloads
# define QT_TR_FUNCTIONS \
- static inline QString tr(const char *s, const char *c = 0) \
- { return staticMetaObject.tr(s, c); } \
- static inline QString tr(const char *s, const char *c, int n) \
+ static inline QString tr(const char *s, const char *c = 0, int n = -1) \
{ return staticMetaObject.tr(s, c, n); }
# endif
#else
@@ -299,11 +291,8 @@ struct Q_CORE_EXPORT QMetaObject
const QObject *cast(const QObject *obj) const;
#ifndef QT_NO_TRANSLATION
- // ### Qt 4: Merge overloads
- QString tr(const char *s, const char *c) const;
- QString trUtf8(const char *s, const char *c) const;
- QString tr(const char *s, const char *c, int n) const;
- QString trUtf8(const char *s, const char *c, int n) const;
+ QString tr(const char *s, const char *c, int n = -1) const;
+ QString trUtf8(const char *s, const char *c, int n = -1) const;
#endif // QT_NO_TRANSLATION
int methodOffset() const;