diff options
author | Kai Koehne <kai.koehne@digia.com> | 2012-09-18 09:57:51 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-16 15:29:15 +0200 |
commit | 8fdef974b7014212947fc409543847d97ec7d5b9 (patch) | |
tree | 23fbe671fa5615ef06004b6df9565efc63fb6483 /src/corelib/global | |
parent | c40333ef505cf0cd9f1102f29473d920fdf7675d (diff) |
Logging: Mark deprecated API with QT_DEPRECATED
Still use it in qtestlib though because using qInstallMessageHandler
here would break all tests (still) using qInstallMsgHandler - Qt always
uses the new message handler if there's one, ignoring any message handler
installed through deprecated API.
Change-Id: I6fefefb315a2421425d2b7787e367fd348a33d83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qlogging.cpp | 6 | ||||
-rw-r--r-- | src/corelib/global/qlogging.h | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 13bbdbead0..e4ff7eece4 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -780,6 +780,12 @@ Q_CORE_EXPORT QString qMessageFormatString(QtMsgType type, const QMessageLogCont return message; } +#if !QT_DEPRECATED_SINCE(5, 0) +// make sure they're defined to be exported +typedef void (*QtMsgHandler)(QtMsgType, const char *); +Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler); +#endif + static QtMsgHandler msgHandler = 0; // pointer to debug handler (without context) static QtMessageHandler messageHandler = 0; // pointer to debug handler (with context) diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h index 0c92e71ad6..4a4eb26321 100644 --- a/src/corelib/global/qlogging.h +++ b/src/corelib/global/qlogging.h @@ -161,9 +161,10 @@ Q_CORE_EXPORT void qt_message_output(QtMsgType, const QMessageLogContext &contex Q_CORE_EXPORT void qErrnoWarning(int code, const char *msg, ...); Q_CORE_EXPORT void qErrnoWarning(const char *msg, ...); -// deprecated. Use qInstallMessageHandler instead! +#if QT_DEPRECATED_SINCE(5, 0)// deprecated. Use qInstallMessageHandler instead! typedef void (*QtMsgHandler)(QtMsgType, const char *); -Q_CORE_EXPORT QtMsgHandler qInstallMsgHandler(QtMsgHandler); +Q_CORE_EXPORT QT_DEPRECATED QtMsgHandler qInstallMsgHandler(QtMsgHandler); +#endif typedef void (*QtMessageHandler)(QtMsgType, const QMessageLogContext &, const QString &); Q_CORE_EXPORT QtMessageHandler qInstallMessageHandler(QtMessageHandler); |