diff options
Diffstat (limited to 'src/corelib')
| -rw-r--r-- | src/corelib/io/qdebug.cpp | 23 | ||||
| -rw-r--r-- | src/corelib/io/qdebug.h | 3 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 56deeb7cf75..f8402dfedae 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -507,6 +507,29 @@ QDebug &QDebug::resetFormat() /*! + \fn bool QDebug::quoteStrings() const + \since 6.7 + + Returns \c true if this QDebug instance will quote strings streamed into + it (which is the default). + + \sa QDebugStateSaver, quote(), noquote(), setQuoteStrings() +*/ + +/*! + \fn void QDebug::setQuoteStrings(bool b) + \since 6.7 + + Enables quoting of strings streamed into this QDebug instance if \a b is + \c true; otherwise quoting is disabled. + + The default is to quote strings. + + \sa QDebugStateSaver, quote(), noquote(), quoteStrings() +*/ + + +/*! \fn QDebug &QDebug::quote() \since 5.4 diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 7390a9c8bce..39f706b0648 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -93,6 +93,9 @@ public: bool autoInsertSpaces() const { return stream->space; } void setAutoInsertSpaces(bool b) { stream->space = b; } + [[nodiscard]] bool quoteStrings() const noexcept { return !stream->noQuotes; } + void setQuoteStrings(bool b) { stream->noQuotes = !b; } + inline QDebug "e() { stream->noQuotes = false; return *this; } inline QDebug &noquote() { stream->noQuotes = true; return *this; } inline QDebug &maybeQuote(char c = '"') { if (!stream->noQuotes) stream->ts << c; return *this; } |
