diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-12-11 22:31:02 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-02-25 15:24:59 +0000 |
commit | 59d1fa25d53c8a5c6974f45284097b69b05ea0d6 (patch) | |
tree | 012f72e4f4b7652a7f6986de62134adc93244fa9 | |
parent | c1c011e355093265f0ac473ee66e7280d95386b9 (diff) |
Make QDebug constructors explicit
So that QDebug objects are not created accidentally.
Change-Id: I73f927fc89c060c838870543be65ea0fd6526c34
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | src/corelib/io/qdebug.h | 8 |
1 files 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 |