diff options
author | Martin Smith <martin.smith@qt.io> | 2019-06-12 15:37:06 +0200 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2019-06-13 04:52:57 +0000 |
commit | 8d2df3002b3a252686bf094566746cd31dc5d99b (patch) | |
tree | 56dab391383bda2a47efe64aa9e056d48b50e86c /src/corelib/kernel/qobject.h | |
parent | 762d4afdc17f96804a83391551fcc7cad26a9319 (diff) |
doc: Fix tr() documentation issue
The declaration of tr() in the Q_OBJECT macro interferes with the
tr() declaration in the QObject class. This update fixes that bug
by resetting QT_TR_FUNCTIONS to be empty and by ensuring that the
tr() declaration in class QObject is seen by clang when qdoc is
running.
Change-Id: If55339fc417f3eee1a1e1ce3df75a18af443d630
Task-number: QTBUG-75864
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/corelib/kernel/qobject.h')
-rw-r--r-- | src/corelib/kernel/qobject.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 63c5a9ad73..fc1d7c956c 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -117,6 +117,7 @@ public: class Q_CORE_EXPORT QObject { Q_OBJECT + Q_PROPERTY(QString objectName READ objectName WRITE setObjectName NOTIFY objectNameChanged) Q_DECLARE_PRIVATE(QObject) @@ -127,7 +128,7 @@ public: virtual bool event(QEvent *event); virtual bool eventFilter(QObject *watched, QEvent *event); -#if defined(QT_NO_TRANSLATION) +#if defined(QT_NO_TRANSLATION) || defined(Q_CLANG_QDOC) static QString tr(const char *sourceText, const char * = nullptr, int = -1) { return QString::fromUtf8(sourceText); } #if QT_DEPRECATED_SINCE(5, 0) |