From 59d1fa25d53c8a5c6974f45284097b69b05ea0d6 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 11 Dec 2019 22:31:02 +0100 Subject: Make QDebug constructors explicit So that QDebug objects are not created accidentally. Change-Id: I73f927fc89c060c838870543be65ea0fd6526c34 Reviewed-by: Lars Knoll --- src/corelib/io/qdebug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 9a6abc1994..48b7538c8e 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -111,10 +111,10 @@ class Q_CORE_EXPORT QDebug void putString(const QChar *begin, size_t length); void putByteArray(const char *begin, size_t length, Latin1Content content); public: - inline QDebug(QIODevice *device) : stream(new Stream(device)) {} - inline QDebug(QString *string) : stream(new Stream(string)) {} - inline QDebug(QtMsgType t) : stream(new Stream(t)) {} - inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; } + explicit QDebug(QIODevice *device) : stream(new Stream(device)) {} + explicit QDebug(QString *string) : stream(new Stream(string)) {} + explicit QDebug(QtMsgType t) : stream(new Stream(t)) {} + QDebug(const QDebug &o) : stream(o.stream) { ++stream->ref; } QDebug(QDebug &&other) noexcept : stream{qExchange(other.stream, nullptr)} {} inline QDebug &operator=(const QDebug &other); QDebug &operator=(QDebug &&other) noexcept -- cgit v1.2.3