Make QDebug constructors explicit

So that QDebug objects are not created accidentally.

Change-Id: I73f927fc89c060c838870543be65ea0fd6526c34
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2019-12-11 22:31:02 +01:00
parent c1c011e355
commit 59d1fa25d5

View File

@ -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